Monday, May 18, 2015

How to check whether Android is running 64 bit version

If you want to check whether your device is running 64 bit version you can check System.getProperty("os.arch"). This will return aarch64 on Samsung S6.
More safe approach would be

boolean is64 = System.getProperty("os.arch").contains("64");
This does not work on Nexus 5x. Because Nexus 5x returns  armv8l

So, I changed my code to

boolean is64 = System.getProperty("ro.product.cpu.abilist").contains("64");

You can use shell command to check  as well

shell@zerolte:/ $ uname -m
uname -m

No comments:

Post a Comment