As part of my app I'm using the NDK and was wondering if it's worth bundling x86 and mips binaries alongside the standard ARM binaries.
I figured the best way would be to track what my users actually have, is there an API call to grab the processor architecture so I can pass this back to my Google analytics instance?
Thanks
For the Android version, look at the OS version under the Device section. This explicitly displays the version number. For architecture info, slide over to the System tab and check out the CPU Architecture and Instruction Sets entries under the Processor tab.
Different Android devices use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction set has its own Application Binary Interface (ABI). An ABI includes the following information: The CPU instruction set (and extensions) that can be used.
Actually, you can get the architecture without the need for reflexion at all:
String arch = System.getProperty("os.arch");
From my tests it returned armv71
and i686
.
EDIT:
On MIPS architecture, it either returns 'mips' or 'mips64'
On 64 bit ARM/Intel, it returns 'aarch64' or 'x86_64' respectively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With