{ "id": "171340", "key": "TIMOB-25878", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-10-25T21:29:46.000+0000", "created": "2018-03-17T04:13:24.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "analytics", "android", "architecture" ], "versions": [ { "id": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" } ], "issuelinks": [ { "id": "56392", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171339", "key": "TIMOB-25877", "fields": { "summary": "Android: \"Ti.Platform.ostype\" wrongly returns \"32bit\" on a 64-bit OS", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-25T21:29:52.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": "*Summary:*\r\nCurrently, the {{Ti.Platform.architecture}} property on Android is difficult to use compared to iOS and Windows. It commonly fails to identify the device's architecture by returning \"Unknown\" or returns a difficult to parse string containing version and revision numbers appended to it.\r\n\r\nBelow is a list of all architecture strings that has been reported to our analytics system:\r\n{code}\r\n'Unknown'\r\n'ARMv7 Processor rev 0 (v7l)'\r\n'ARMv7 Processor rev 4 (v7l)'\r\n'AArch64 Processor rev 4 (aarch64)'\r\n'ARMv7 Processor rev 3 (v7l)'\r\n'AArch64 Processor rev 1 (aarch64)'\r\n'ARMv7 Processor rev 5 (v7l)'\r\n'AArch64 Processor rev 2 (aarch64)'\r\n'AArch64 Processor rev 3 (aarch64)'\r\n'AArch64 Processor rev 0 (aarch64)'\r\n'ARMv7 Processor rev 1 (v7l)'\r\n'ARMv7 Processor rev 2 (v7l)'\r\n'ARMv8 Processor rev 2 (v8l)'\r\n'ARMv7 Processor rev 8 (v7l)'\r\n'ARMv7 Processor rev 10 (v7l)'\r\n'ARMv7 Processor rev 9 (v7l)'\r\n'ARMv7 processor rev 4 (v7l)'\r\n'64-bit ARMv8 Processor rev 0 (v7l)'\r\n'AArch64 Processor rev 13 (aarch64)'\r\n'ARMv7 processor rev 1 (v7l)'\r\n'sc7731 rev 5 (v7l)'\r\n'64-bit ARMv8 Processor rev 1 (v7l)'\r\n'NVIDIA Denver 1.0 rev 0 (aarch64)'\r\n'MT6732 rev 2 (v7l)'\r\n'AArch64 Processor rev 12 (aarch64)'\r\n'ARMv6-compatible processor rev 5 (v6l)'\r\n'6591 rev 4 (v7l)processor'\r\n'ARMv7'\r\n'mtk6580L rev 5 (v7l)'\r\n'ARMv8 Processor rev 4 (aarch64)'\r\n'Qualcomm Snapdragon 800'\r\n'UNIVERSAL5410'\r\n'ARMv7 Processor rev 12 (v7l)'\r\n'MT6592 2.0GHZ (Octa-Core) rev 5 (v7l)'\r\n'ARMv7 Processor rev 3 srev 0x23 (v7l)'\r\n'MTK6580 rev 5 (v7l)'\r\n'ARMv7 Processor rev 2 srev 0x23 (v7l)'\r\n'ARMv7 Processor rev 6 (v7l)'\r\n'S805'\r\n'ARMv8 processor rev 1 (aarch64)'\r\n'UNKNOWN rev 0 (UNKNOWN)'\r\n'ARMv7 Processor'\r\n'Quad-Core ARMv7 Processor'\r\n'ARMv8 Processor rev 5 (v7l)'\r\n'S905'\r\n'ARMv7 Processor rev 5 rev 5 (v7l)'\r\n'ARMv7 processor (v7l)'\r\n'Quadcore Cortex-A71.2GHz rev 5 (v7l)'\r\n'arm'\r\n'MT6592 2.0GHZ rev 5 (v7l)'\r\n{code}\r\n\r\nI've tested the following devices and they return the following:\r\n||Device Name||Returned Architecture String||\r\n|Emulator|Unknown|\r\n|Pixel XL|Unknown|\r\n|Galaxy Tab 3|Unknown|\r\n|Galaxy Nexus|ARMv7 Processor rev 10 (v7l)|\r\n|Galaxy Note 2|ARMv7 Processor rev 0 (v7l)|\r\n|Nexus 4|ARMv7 Processor rev 2 (v7l)|\r\n|Nexus 5|ARMv7 Processor rev 0 (v7l)|\r\n|Nexus 10|ARMv7 Processor rev 4 (v7l)|\r\n|Pixel 2|AArch64 Processor rev 1 (aarch64)|\r\n|Amazon Fire HD 8 (7th gen)|AArch64 Processor rev 3 (aarch64)|\r\n\r\nNote that \"Unknown\" is the most commonly reported architecture name in our analytics system. Odds are most of these are coming from Google's Android emulator.\r\n\r\n*Cause:*\r\nThe {{Ti.Platform.architecture}} property uses our APS library to fetch the architecture name, which attempts to fetch this string from a system file named \"cpuinfo\". This is an undocumented feature that we should avoid. Especially since it's proven to be unreliable and causes \"Unknown\" to be returned.\r\n[APSAnalyticsHelper.java#L339|https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/android/analytics/APSAnalytics/src/main/java/com/appcelerator/aps/APSAnalyticsHelper.java#L339]\r\n\r\n*Recommended Solution:*\r\nThe APS library's {{getArchitecture()}} method should be changed to fetch architecture via Google's {{android.os.Build}} class using its {{Build.SUPPORTED_ABIS}} and {{Build.CPU_ABI}} constants.\r\nhttps://developer.android.com/reference/android/os/Build.html\r\n\r\nI've tested the above constants on real Android devices and in the emulator. The above always return strings matching the APK's lib folder architecture subfolder names, where the {{*.so}} C/C++ libraries are kept. With the only exception being with the \"x86_64\" being returned by the emulator. For example:\r\n* armeabi-v7a\r\n* arm64-v8a\r\n* x86\r\n* x86_64\r\n\r\n*Ideal Solution:*\r\nAndroid should ideally return the same architecture string types that iOS does. This would make it easier to work with from a portability standpoint. It would also make it easier from an analytics standpoint to identify popular architectures between platforms.\r\n\r\niOS fetches CPU architecture from the APS library here...\r\n[APSUtility.m#L24|https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/ios/support/analytics/APSAnalytics/APSUtility.m#L24]\r\n\r\niOS currently returns the following hardcoded strings:\r\n* x86_64\r\n* arm\r\n* armv6\r\n* armv7\r\n* armv7s\r\n* arm64\r\n* i386\r\n\r\n*Work-Around:*\r\nYou can use hyperloop to fetch the architecture using the above mentioned Java \"Build\" class constants.\r\n{code:javascript}\r\n// WARNING: You must add \"hyperloop\" module to the project for the below to work.\r\nvar buildClass = require(\"android.os.Build\");\r\nif (Ti.Platform.Android.API_LEVEL >= 21) {\r\n\tTi.API.info(\"@@@ Build.SUPPORTED_ABIS[0]: \" + buildClass.SUPPORTED_ABIS[0]);\r\n} else {\r\n\tTi.API.info(\"@@@ Build.CPU_ABI: \" + buildClass.CPU_ABI);\r\n}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Modify \"Ti.Platform.architecture\" to provide consistent results like iOS", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 }, { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 }, { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 }, { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 }, { "id": 1035, "state": "closed", "name": "2018 Sprint 11 SDK", "startDate": "2018-05-20T20:57:43.542Z", "endDate": "2018-06-03T20:57:00.000Z", "completeDate": "2018-06-04T15:13:14.425Z", "originBoardId": 114 }, { "id": 1070, "state": "closed", "name": "2018 Sprint 18 SDK", "startDate": "2018-08-26T16:14:35.297Z", "endDate": "2018-09-09T16:14:00.000Z", "completeDate": "2018-09-11T20:59:21.495Z", "originBoardId": 114 }, { "id": 1039, "state": "closed", "name": "2018 Sprint 12 SDK", "startDate": "2018-06-03T15:22:23.401Z", "endDate": "2018-06-17T15:22:00.000Z", "completeDate": "2018-06-18T20:45:36.363Z", "originBoardId": 114 }, { "id": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 }, { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 }, { "id": 1078, "state": "closed", "name": "2018 Sprint 20 SDK", "startDate": "2018-09-23T16:57:58.349Z", "endDate": "2018-10-07T16:57:00.000Z", "completeDate": "2018-10-07T23:31:40.476Z", "originBoardId": 114 }, { "id": 1050, "state": "closed", "name": "2018 Sprint 14 SDK", "startDate": "2018-07-01T18:40:57.193Z", "endDate": "2018-07-15T18:40:00.000Z", "completeDate": "2018-07-16T03:27:08.720Z", "originBoardId": 114 }, { "id": 1084, "state": "closed", "name": "2018 Sprint 21", "startDate": "2018-10-07T23:32:40.560Z", "endDate": "2018-10-21T23:32:00.000Z", "completeDate": "2018-10-21T23:19:05.460Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 }, { "id": 1088, "state": "closed", "name": "2018 Sprint 22", "startDate": "2018-10-21T23:20:52.653Z", "endDate": "2018-11-04T23:20:00.000Z", "completeDate": "2018-11-04T23:29:59.423Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437014", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "aps_sdk: https://github.com/appcelerator/aps_sdk/pull/314", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-19T18:49:43.000+0000", "updated": "2018-04-19T18:49:43.000+0000" }, { "id": "441197", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~gmathews], this was merged. Can we close it?", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-29T18:14:27.000+0000", "updated": "2018-08-29T18:14:27.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }