Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25877] Android: "Ti.Platform.ostype" wrongly returns "32bit" on a 64-bit OS

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-11-19T18:41:22.000+0000
Affected Version/sRelease 7.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsanalytics, android, architecture
ReporterJoshua Quick
AssigneeGary Mathews
Created2018-03-17T02:48:29.000+0000
Updated2018-11-19T18:41:25.000+0000

Description

*Summary:* The Ti.Platform.ostype property is currently hardcoded to return "32bit" on Android. [APSAnalyticcsHelper.java#L235](https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/android/analytics/APSAnalytics/src/main/java/com/appcelerator/aps/APSAnalyticsHelper.java#L235) Now that Titanium supports building Android apps for ARM64, it should return "64bit" when running on a 64-bit Android device like how it works for iOS here... [APSUtility.m#L15](https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/ios/support/analytics/APSAnalytics/APSUtility.m#L15) *Steps to Reproduce:*

Build an run the below code on a 64-bit Android device, such as a Pixel XL phone.

Observe the log for an "ostype:" entry.

Ti.API.info("@@@ ostype: " + Ti.Platform.ostype);
*Note:* We had to do something similar for iOS as can be seen here: [TIMOB-18193] *Recommended Solution:* Check if array returned by android.os.Build.SUPPORTED_64_BIT_ABIS contains at least 1 element. https://developer.android.com/reference/android/os/Build.html#SUPPORTED_64_BIT_ABIS Note that Google added 64-bit support as of Android 5.0 (aka: API Level 21). So, you can't use Google's Process.is64Bit() method since it is only supported on Android 6.0 and higher. https://developer.android.com/reference/android/os/Process.html#is64Bit()

Comments

  1. Gary Mathews 2018-04-19

    aps_sdk: https://github.com/appcelerator/aps_sdk/pull/314
  2. Joshua Quick 2018-08-29

    [~gmathews], this is done, right? I can see that it was already merged.

JSON Source