diff options
author | Christian S <kriztan@users.noreply.github.com> | 2015-10-06 10:24:53 +0200 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-10-07 12:30:08 +0200 |
commit | dc853f7c9d0dcc63ee8e37d9ac34cda0609ad2e2 (patch) | |
tree | 27c7a5e228a7ef60271d56460c419fdaef9f928c /src/main/java/eu | |
parent | 8114668e57b4aa496099120d34ec57744cd66ea2 (diff) |
Added more info to alertbox
added changelog to JSON object in updater
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java | 3 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java | 15 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java b/src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java index 0fffb8a78..ddc89e1a4 100644 --- a/src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java +++ b/src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java @@ -33,6 +33,7 @@ public class CheckAppVersionService extends HttpServlet { myObj.addProperty("success", true); myObj.addProperty("latestVersionCode", 2); myObj.addProperty("latestVersion", "1.0.0"); + myObj.addProperty("changelog", ""); myObj.addProperty("appURI", ""); out.println(myObj.toString()); out.close(); @@ -40,4 +41,4 @@ public class CheckAppVersionService extends HttpServlet { } -}
\ No newline at end of file +} diff --git a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java index 4f43a70b8..3df4dca75 100644 --- a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java @@ -155,9 +155,21 @@ public class UpdaterActivity extends Activity { boolean success = responseObj.getBoolean("success"); //if the reponse was successful check further if(success){ + //Overall information about the contents of a package + //This corresponds to all of the information collected from AndroidManifest.xml. + PackageInfo pInfo = null; + try { + pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); + } + catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + //get the app version Name for display + String version = pInfo.versionName; //get the latest version from the JSON string int latestVersionCode = responseObj.getInt("latestVersionCode"); String latestVersion = responseObj.getString("latestVersion"); + String changelog = responseObj.getString("changelog"); /* //display the new version in a TextView TextView versionText = (TextView) findViewById(R.id.versionName); @@ -174,7 +186,8 @@ public class UpdaterActivity extends Activity { AlertDialog.Builder builder = new AlertDialog.Builder(UpdaterActivity.this); builder.setCancelable(false); - builder.setMessage(R.string.update_available) + String UpdateMessageInfo = getResources().getString(R.string.update_available); + builder.setMessage(String.format(UpdateMessageInfo, latestVersion, changelog, version)) .setPositiveButton(R.string.update, new DialogInterface.OnClickListener() { //if the user agrees to upgrade public void onClick(DialogInterface dialog, int id) { |