Java me J2ME中的MDM(移动设备管理)
我想在J2ME中实现MDM。每当我更新应用程序时,我都可以在手机上上传新的应用程序,我可以成功上传它。但我的问题是,我想替换现有的应用程序,然后上传新的应用程序。到目前为止,我可以在设备上添加不同名称的应用程序(相同的应用程序名称不起作用),但不能替换应用程序 以下是我的MDM代码:Java me J2ME中的MDM(移动设备管理),java-me,mdm,Java Me,Mdm,我想在J2ME中实现MDM。每当我更新应用程序时,我都可以在手机上上传新的应用程序,我可以成功上传它。但我的问题是,我想替换现有的应用程序,然后上传新的应用程序。到目前为止,我可以在设备上添加不同名称的应用程序(相同的应用程序名称不起作用),但不能替换应用程序 以下是我的MDM代码: public void getUpdateApp() { new Thread(new Runnable() { public void run() { t
public void getUpdateApp() {
new Thread(new Runnable() {
public void run() {
try {
DataHelper dh = new DataHelper(parent);
dh.openRecord();
String response_rms = dh.getupdateAppinfo_str();
System.out.println("response from RMS of Update App info in appupdate---" + response_rms);
System.out.println("Sending update App Call.");
HttpConn httpConnect = new HttpConn(parent);
UserInfo userInfo = getUserInfo();
String data = "AppCode=" + AppData.appCode+ "&CurrentVersion=" + AppData.currentversion
+ "&TerminalNumber=" + userInfo.getTerminalNumber()
+ "&apifunction=" + "GetAppUpdate";
httpConnect.sendPostRequest_appupdate(AppData.AppUpdateURL, data, new ConnectionListener() {
public void onRequestFailure(Object title, Object message) {
System.out.println("==>GetUpdateApp Failure\nTitle:"
+ (String) title
+ "\n Failure Message" + (String) message);
showMessageDialog((String) title, (String) message, new SettingsForm("Settings", parent), 2000);
}
public void onRequestSuccess(Object httpResponse) {
try {
System.out.println("==>On Success--of Update App");
String response = (String) httpResponse;
System.out.println("==>Login Form--Update App \nResponse:" + response);
JSONObject jsonObject = new JSONObject(response);
int responseCode = Integer.parseInt(jsonObject.getString("ResponseCode"));
switch (responseCode) {
case 000: {
String latestbuild = jsonObject.getString("LatestBuild");
String latestversion = jsonObject.getString("LatestVersion");
String downloadURL = jsonObject.getString("DownloadURL");
if (latestversion != null) {
if (!latestversion.equals(AppData.currentversion) || !latestbuild.equals(AppData.currentBuild)) {
if (Integer.parseInt(latestbuild) > Integer.parseInt(AppData.currentBuild)) {
System.out.println("Download URL--" + downloadURL);
// parent.platformRequest(downloadURL);
System.out.println("platform request boolean variable returns---"+ parent.platformRequest(downloadURL));
parent.platformRequest(downloadURL);
parent.destroyApp(true);
} else {
System.out.println("Incomapatible types");
showMessageDialog("Alert", "No new updates available", new SettingsForm("Settings", parent),2000);
}
} else {
System.out.println("App Version Number is same,No New Build Available");
showMessageDialog("Alert", "Application is already upto date", new SettingsForm("Settings", parent),2000);
}
} else {
System.out.println("App version not available on server");
showMessageDialog("Alert", "No new updates available", new SettingsForm("Settings", parent),2000);
}
break;
}
}
} catch (JSONException ex) {
ex.printStackTrace();
showdisplayExceptionDialog(ex, new SettingsForm("Settings", parent));
} catch (ConnectionNotFoundException ex) {
showdisplayExceptionDialog(ex, new SettingsForm("Settings", parent));
}
}
});
} catch (Exception e) {
showdisplayExceptionDialog(e, new SettingsForm("Settings", parent));
}
}
}).start();
}
如果有任何1有任何关于在J2ME中更换应用程序的想法,请帮助我。先谢谢你