How to Manage Prompt Installation of APKs Configured in TMS: Difference between revisions

From wizarPOS
No edit summary
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/tms-wizarview/manage-apk-prompt-installation}}")
Tag: Replaced
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
  Sometimes, for kiosk terminal, it need decide when to install apk. So for apk in TMS, need configure prompt installing mode, then customer apk can receive download finishing broadcast, and send notice to wizarview agent to install apk. Wizarview agent version should be greator than 5.3.39.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/tms-wizarview/manage-apk-prompt-installation}}
== Receive download ==
  Receive the broadcast, action:android.intent.action.TMS_DOWNLOADED  extra value name: apk_notify_info  type: JSONArray, for example: [{"appId":19068,"newVersion":1,"newVersionName":"1.0","packageName":"com.liqi.myapp20210324"}]
* Register broadcast
<syntaxhighlight lang="java" line='line'>
  <receiver
android:name=".receiver.ApkDownloadedReceiver">
    <intent-filter>
        <action android:name="android.intent.action.TMS_DOWNLOADED" />
    </intent-filter>
</receiver>
</syntaxhighlight>
* Extends class of the BroadcastReceiver
<syntaxhighlight lang="java" line='line'>
    String apk_notify_info = intent.getStringExtra("apk_notify_info");
</syntaxhighlight>
 
== Notice to install ==
  Send broadcast to install, action: android.intent.action.TMS_INSTALL  extra value name: apk_start_install_notify_info type: JSONArray, for example: [{"appId":19068,"newVersion":1,"newVersionName":"1.0","packageName":"com.liqi.myapp20210324"}]
<syntaxhighlight lang="java" line='line'>
    Intent intent = new Intent();
    intent.putExtra("apk_start_install_notify_info", JSON.toJSONString(apkNotifyInfos));
    intent.setAction("android.intent.action.TMS_INSTALL");
    context.sendBroadcast(intent);
</syntaxhighlight>
 
== ApkNotifyInfo class==
<syntaxhighlight lang="java" line='line'>
  class ApkNotifyInfo {
        private int appId;
        private String packageName;
        private long newVersion;
        private String newVersionName;
 
        public ApkNotifyInfo() {
        }
 
        public ApkNotifyInfo(int appId, String packageName, long newVersion, String newVersionName) {
            this.appId = appId;
            this.packageName = packageName;
            this.newVersion = newVersion;
            this.newVersionName = newVersionName;
        }
 
        public int getAppId() {
            return appId;
        }
 
        public void setAppId(int appId) {
            this.appId = appId;
        }
 
        public String getPackageName() {
            return packageName;
        }
 
        public void setPackageName(String packageName) {
            this.packageName = packageName;
        }
 
        public long getNewVersion() {
            return newVersion;
        }
 
        public void setNewVersion(long newVersion) {
            this.newVersion = newVersion;
        }
 
        public String getNewVersionName() {
            return newVersionName;
        }
 
        public void setNewVersionName(String newVersionName) {
            this.newVersionName = newVersionName;
        }
}
</syntaxhighlight>

Latest revision as of 05:08, 8 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/tms-wizarview/manage-apk-prompt-installation

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!