{ "id": "119803", "key": "TIMOB-15267", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15931", "description": "2014 Sprint 05", "name": "2014 Sprint 05", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15932", "description": "2014 Sprint 05 API", "name": "2014 Sprint 05 API", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-07T19:03:40.000+0000", "created": "2013-09-11T22:21:32.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "module_app", "qe-testadded", "version", "versioning" ], "versions": [], "issuelinks": [ { "id": "36413", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "128592", "key": "AC-3289", "fields": { "summary": "'Ti.App.Android.appVersionCode' & 'Ti.App.Android.appVersionName' property of android gives undefines when run on device", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-04-23T00:43:03.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "I think it would be very useful to expose the versionName and versionCode on Ti.Platform.\r\n\r\nFirst for creating dynamic About Windows and for internal migration procedures relying on this information.\r\n\r\nAnd 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.\r\n\r\nThis way I can always get the accurate user's app build number.\r\n\r\n\r\nThere is a way of doing that in Android SDK:\r\n\r\n{code}\r\nPackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0);\r\nint versionCode = pinfo.versionCode;\r\nString versionName = pinfo.versionName;\r\n{code}\r\n\r\nI think you guys should map that inside Ti.Platform so we can access it dynamically.\r\n\r\nSomething like Ti.Platform.versionCode and Ti.Platform.versionName (of course they are Android only).\r\n", "attachment": [], "flagged": false, "summary": "Android: Expose versionName and versionCode inside the Ti.App.Android", "creator": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": "Ti SDK 3.1.2.GA\r\nAndroid 4.2", "comment": { "comments": [ { "id": "273051", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Why this was marked as Incomplete?", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-09-26T21:45:28.000+0000", "updated": "2013-09-26T21:45:28.000+0000" }, { "id": "285020", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Exposed app VersionName and VersionCode\r\nhttps://github.com/appcelerator/titanium_mobile/pull/5145", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-12-18T17:08:09.000+0000", "updated": "2013-12-18T17:08:09.000+0000" }, { "id": "291625", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Test case\n\nTi.API.info(\"AppVersionCode = \"+ Ti.Media.Android.appVersionCode + \" AppVersionName = \" +Ti.Media.Android.appVersionName);", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-02-06T14:17:48.000+0000", "updated": "2014-02-06T14:17:48.000+0000" }, { "id": "293438", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "@Sunila Ti.Media ???", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2014-02-17T16:13:31.000+0000", "updated": "2014-02-17T16:13:31.000+0000" }, { "id": "295257", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "My bad, I have updated the pull request\n\nTest case\n\nTi.API.info(\"AppVersionCode = \"+ Ti.App.Android.appVersionCode + \" AppVersionName = \" +Ti.App.Android.appVersionName);", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-03T16:23:57.000+0000", "updated": "2014-03-03T16:23:57.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }