How to download and install .apk file in Android app?

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 the .apk file and install it automatically. So can someone please give me solutions to these problems?

0
source share
2 answers

Just follow these steps:

1, Download the file using Asynctask or Service. Solution here

2. Transfer the downloaded file to the 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);

mime. . . ,

+2

url enter, . . Htc mobile, , samsung

0

Source: https://habr.com/ru/post/1540537/


All Articles