Currently this feature only supports the RC Pro Enterprise with firmware v02.00.04.07. It will be also supported by the RC Plus in future firmware. The developers can remotely install an apk to the RC. The steps are listed following.
- Call RemoteControllerKey.KeyAPPSilentlyUpgrade(a action key) to setup the app package name into the whitelist. Please be noted this configuration will be wiped off after rebooting the RC.
- Inside AndroidManifest.xml file, you need to add the provider section and permission.
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" /><provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
</provider> - Place your apk under the directory: /sdcard/Android/data/your app package name/files/your apk name.apk.
- The install command is listed below.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
final File file = new File(getExternalFilesDir("."), "your app name.apk");
Uri uri = FileProvider.getUriForFile(this, getPackageName() + ".fileProvider", file);
intent.setDataAndType(uri, "application/vnd.android.package-archive");
startActivity(intent);
Comments
0 comments
Please sign in to leave a comment.