Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Android app through OTA service

I have developed 5 android applications and generated the 5 apk files with same keystore. Of the 5 apps, one app is the home app which contains a common database. All other apps are accessing the database using the content provider.

Now, I want the user to download the all 5 apk files through the OTA service. After the download completed the home app first get started to install and after the installation completed automatically the second app get started to install and likewise for all 5 apks. Is there anyway to achieve this?

like image 994
Rajesh Rajaram Avatar asked Sep 24 '12 11:09

Rajesh Rajaram


1 Answers

You can prompt an install

Intent promptInstall = new Intent(Intent.ACTION_VIEW) 
    .setData(Uri.parse("file:///path/to/your.apk")) 
    .setType("application/vnd.android.package-archive"; 
startActivityForResult(promptInstall);

One's the user has accepted and installed, you will get a callback on which you can invoke the next APK install. You could also use PackageManager to check if the user has installed the APK successfully

like image 135
Royston Pinto Avatar answered Oct 12 '22 20:10

Royston Pinto