-
The function implemented by the following code is: for Android system development, click the button to download an APK file from the server, and then open the APK file to update the application. `import flash.filesystem.*; // 主时间线上的代码 // 创建UI元素 function createUI():void {
} function createButton(label:String, color:uint = 0x3498db):Sprite {
} function downloadAndInstallAPK(apkUrl:String, apkName:String, progressText:TextField):void {
} function installAPK(apkFile:File, progressText:TextField):void {
} function showManualInstallAlert(apkFile:File, progressText:TextField):void {
} ` |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 22 replies
-
seek help! Does anyone understand? thank you! |
Beta Was this translation helpful? Give feedback.
-
You can use my package manager extension for this: https://docs.airnativeextensions.com/docs/packagemanager/installing-apps It's freely available here: |
Beta Was this translation helpful? Give feedback.
-
When I tried to add ANE and package it for installation as required, the installation was normal, but when I opened the app, it immediately crashed.
|
Beta Was this translation helpful? Give feedback.
Firstly, as Andrew mentioned, looks like you are trying to use too recent tools. Try installing:
Secondly, when
canRequestApplicationInstalls
returns false it means your user hasn't granted permission for your app to install apps. You need to redirect them to the settings by calling:PackageManager.service.showManageUnknownAppSourcesSettings();
See here for more: https://docs.airnativeextensions.com/docs/packagemanager/installing-apps#settings