I have one java Web Application through this application I am sending the URL to download the .apk file.now I have to use this URL in my Android Simulator browser to download .apk file and install automatically. So can anyone please give me the solutions to this problems?
Asked
Active
Viewed 9,769 times
1
-
1type the url in browser it will download and then you can install it – Shankar Agarwal Apr 18 '12 at 06:24
-
I want to install the .apk file automatically after completing the downloading. – suhaspt89 Apr 18 '12 at 06:29
-
http://stackoverflow.com/a/4969421/1075066 – Its not blank Apr 18 '12 at 07:38
2 Answers
3
Just do these step:
1, Download file use Asynctask or Service. Solution here
2, Pass downloaded file to package installer.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent);
It's simple set path to downloaded file and mime type. More detail here. You can also look to the right. There is a list of related questions like yours

Community
- 1
- 1

Trung Nguyen
- 7,442
- 2
- 45
- 87
-
After you install it, is there a way to re-launch the application? Right now it just returns to the home screen and you have to manually re-launch it. – Joshua Pinter Nov 03 '18 at 01:50
0
In browser type url and press enter ,it will ask to install. But file automatically installation process is basing on Device. If you go for Htc mobile It will be automatically installed but not for samsung mobiles

Ramachandra Reddy Avula
- 1,094
- 11
- 21