From an Android app, I like to install an apk file from a web server. This apk file contains an update for the app.
All tutorials do this in two steps:
- Download the file and save it to the phone’s sd card memory.
- Create a new Intent(Intent.ACTION_VIEW) and run the method setDataAndType(Uri.fromFile(new File(“…. of this intent.
However, since Android Nougat, you get into trouble with permission to access the sd card memory. There are (complicated) solutions for this problem.
My question: is there a way to create an Intent, which gets a web URL as source for the apk file. Something like intent.setDataAndType(new URL(“http://….”)
This is easy for the programmer and it provides as clear interface from the program to the Android system.