[TIMOB-15267] Android: Expose versionName and versionCode inside the Ti.App.Android
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-07T19:03:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 05, 2014 Sprint 05 API, Release 3.3.0 |
Components | Android |
Labels | android, module_app, qe-testadded, version, versioning |
Reporter | Ygor Lemos |
Assignee | Sunila |
Created | 2013-09-11T22:21:32.000+0000 |
Updated | 2014-04-23T00:43:03.000+0000 |
Description
I think it would be very useful to expose the versionName and versionCode on Ti.Platform.
First for creating dynamic About Windows and for internal migration procedures relying on this information.
And second (and this is the most important for me), for getting the app build number that the client is using. This is specially useful for Beta Testing (through the Google Play Store) and for fast iteration of app versions, when you need to identify which version/build the user is running.
This way I can always get the accurate user's app build number.
There is a way of doing that in Android SDK:
PackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0);
int versionCode = pinfo.versionCode;
String versionName = pinfo.versionName;
I think you guys should map that inside Ti.Platform so we can access it dynamically.
Something like Ti.Platform.versionCode and Ti.Platform.versionName (of course they are Android only).
Why this was marked as Incomplete?
Exposed app VersionName and VersionCode https://github.com/appcelerator/titanium_mobile/pull/5145
Test case Ti.API.info("AppVersionCode = "+ Ti.Media.Android.appVersionCode + " AppVersionName = " +Ti.Media.Android.appVersionName);
@Sunila Ti.Media ???
My bad, I have updated the pull request Test case Ti.API.info("AppVersionCode = "+ Ti.App.Android.appVersionCode + " AppVersionName = " +Ti.App.Android.appVersionName);