0

I'm going to develop an android app for a museum, which will handle a tablet with the app installed on it to the visitors. The app will be on foreground full time and visitor will only be able to use this app.

Since there will be many tablets, and they are all under our control, I would like a way to update all the tablets remotly with the last version of the app.

Is there a way to achive this?

Federico Ponzi
  • 2,682
  • 4
  • 34
  • 60

1 Answers1

0

Is there a way to achive this?

Answer is : Yes but with one exception lets have a look.

Step 1 : Create a local server for your museum. I guess it is already in the museum.

Step 2 : Now In your android application whenever you start your app check that whether new version of APK is available. For checking APK new version you can use this code.

PackageInfo packageInfo = getPackageManager().getPackageInfo(context.getPackageName(), 0);
int apkVersion = packageInfo.versionCode;

You should set your APK name like "yourAppname_version" so whenever you upload the new app to your local server just change the name so you can easily identify that new version of APK is available or not.

Step 3 : If new version is available then start downloading APK from the local server and save it to your storage directory.

Step 4 : When downloading completed you can call this set of code to install the new APK.

Intent intentApkInstall = new Intent(Intent.ACTION_VIEW);
intentApkInstall.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"yourAppname_version.apk")), "application/vnd.android.package-archive");
intentApkInstall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentApkInstall);

Now the Exception part is here the above code will prompt user to install APK. So in this case you have to install it manually.

Andy Developer
  • 3,071
  • 1
  • 19
  • 39