Hi guys was wondering if there was a bit of code I could use that would make an app auto install once the download completes?
My app has a download section with in it. I was using Google Drive to handle the downloads. but I am encountering issues with some devices. So I have decided to move away from google
I am now using media fire as my host. My app uses direct download. But it always downloads using the download manager. What I would like it to do is more like how Google Drive works with direct download. Which is it gives me the option to install as soon as download completes.which i have now solved with these few lines of code
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new
File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")),
"application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
is there a way to check download folder before downloading the file. if the file is already there install if not got to web page for download. rather it saying parse error then going to webpage or having multiple downloads of same file.
Thanks in advance as always.