OTA updates for Device Owner Android Application(Kiosk mode) OTA updates for Device Owner Android Application(Kiosk mode) android android

OTA updates for Device Owner Android Application(Kiosk mode)


This is just pure speculation as I've never tried to use the package installer API myself:

You could try to set an installer package for your device owner app (using PackageManager.setInstallerPackageName()). This installer package would need to be a separate APK signed with the same certificate as the device owner APK.

getPackageManager().setInstallerPackage("<device.owner.package.name>", "<installer.package.name>");

From your installer APK, you could then use PackageInstaller to prepare an update:

PackageInstaller pi = getPackageManager().getPackageInstaller();int sessId = pi.createSession(new PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL));PackageInstaller.Session session = pi.openSession(sessId);OutputStream out = session.openWrite("app");// .. write updated APK file to outsession.fsync(out);session.commit(...);session.close();

I'm not sure if this silently installs your update though (or if that works at all in the way I would have expected).


Create a service to background check for update. if update available download apk file and write it on some where like sdcard. wait some seconds to write completely flush. then call following code to install your new apk.

Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive");startActivity(intent);

fileName is path of your new apk file on sd card.


You could use Play Store to provide updates for your app:

  1. Provision device owner app through NFC, just as you already did.

  2. Provide an updated version (same package name, same signature, higher version number) of your device owner app on Play Store.

  3. In the Play Store app on your device, search for your Play Store version of the app and install the update.

  4. Activate auto-updates for your device owner app in Play Store (on the Play Store page of your app, click menu (three dots) and activate the checkbox for auto-update.

That's quite some effort for the provisioning phase, but the device should receive future updates automatically.