Software Archive
Read-only legacy content
17061 Discussions

Find out if the mobile is ARM or X86

Sam_Deepak
Beginner
1,829 Views

Hi All,

I am likely releasing the first version of my app by this month end. I am using Crosswalk build for this.

I just want to know if there is a way to programmatically know if the mobile CPU is of  ARM or x86  using cordova, or intel xdk api , then based on that download an installer.

 

Regards,

Sam Deepak.

 

0 Kudos
10 Replies
Swati_S_Intel1
Employee
1,829 Views

If you are submitting to google play, you follow the submission guidelines https://software.intel.com/sites/default/files/managed/9a/72/Intel_Walkthrough_GP-Multiple_APK_Submissions.pdf and you submit both x86 and arm .apk. When your user downloads, a platform specific apk is downloaded on the device, so you do not need to programatically find out which .apk to install.

0 Kudos
Sam_Deepak
Beginner
1,829 Views

Hi Swati,

The app is not distributed through google play store. Everything is taken care i.e., registration, payment gateway, piracy, security and all that by me. So I want to know a way of finding out what type of .apk whether it is x86 or ARM for the target user.

Can you suggest me something.

Regards,

Sam Deepak.

 

0 Kudos
Barry_Johnson
New Contributor I
1,829 Views

So you are writing the installer/loader for this app?

How does that installer/loader app get on the user's device? I ask because if that app is loaded from a legitimate store that handles this automatically, you could do two separate builds for each x86 and ARM, each with some flag set appropriately. It would eliminate the need to auto-detect.

Otherwise, you might want to look at this plugin (org.chromium.system.cpu) which exposes the chrome.system.cpu API (doc here).

0 Kudos
Barry_Johnson
New Contributor I
1,829 Views

One additional note: you might want to look at "navigator.platform"

Although I wouldn't depend on it unless you already have a narrowed universe of systems:

http://stackoverflow.com/questions/19877924/what-is-the-list-of-possible-values-for-navigator-platform-as-of-today

0 Kudos
Swati_S_Intel1
Employee
1,829 Views

Oh I see. I'm not aware of any Intel XDK or Cordova API that gives the device architecture info. In Android app (Java) it is possible to get that info using os.arch property: 

String arch = System.getProperty("os.arch");

The only option I can think of is, wrap this call in a plugin that you could call from JavaScript. 

 

0 Kudos
Sam_Deepak
Beginner
1,829 Views

Hi,

I am analyzing all these options, I will update you with my findings,

Regards,

Sam Deepak.

 

0 Kudos
Sam_Deepak
Beginner
1,829 Views

Hi All,

 

I tried with parsing some values from chrome.system.cpu and navigator.platform and got the architecture. Used file transfer to download the actual file and opened it. This funcionality I put into an app which will be treated as app installer which detects cpu , downloads the proper apk and open it, and then automatically exit.

To confirm the accuracy of detection, need to test it with many devices.

Thanks a lot for your help. 

 

Regards,

Sam Deepak.

0 Kudos
PaulF_IntelCorp
Employee
1,829 Views

If you are in a Cordova container (which is the case when you build with the XDK) and you include the Cordova "device" plugin you can also extract some useful info from the device properties (see https://github.com/apache/cordova-plugin-device)

0 Kudos
Sam_Deepak
Beginner
1,829 Views

Hi

The device plugin gives only device id, platform, device type, os version. But now after testing it with people, I reverted back to cordova android app from crosswwalk, as I got reviews from people they dont want two icons or apps in the mobile. Some people by psychology, they clicked on app loader even after installing the app. 

I need to do more research on how to make it happen such that the app loader should do all calculations to determine what to download (version, x86/arm and etc) and install the actual app and uninstalls itself. 

So for 1st version, I am going with cordova andriod build instead of crosswalk build and will be distributed  from website.

If you have any solutions to make it work for crosswalk buid, it will be a great help. But the crosswalk build outputs a very heavy file. The advantage is faster performance and support for wide variety of features and consistent look.

Regards,

Sam Deepak.

 

0 Kudos
PaulF_IntelCorp
Employee
1,829 Views

The way to get a single download for Crosswalk from the XDK is to use the "shared mode" build, but we do not yet have a system in place for you to distribute the Crosswalk shared mode library that is needed for that solution (it is currently only distributed via the Google store). There is work in progress to address that, but it depends on the Crosswalk team finishing that part of the project. Please file a Jira on the Crosswalk bug site to let them know you need that feature if you wish to use it.

0 Kudos
Reply