How to know a process of an app is 32-bit or 64-bit programmatically in Android lollipop?

In Nexus 5x

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



it is not aarch64 and my code broke. However,

root@bullhead:/ # uname -m

root@bullhead:/ # getprop ro.product.cpu.abilist

Wired. So I changed my code to

boolean is64 = (android.os.Build.VERSION.SDK_INT >= 21) && System.getProperty("ro.product.cpu.abilist").contains("64");

Updated on 2016-02-11

In Samsung Samsung Galaxy S5 Neo, Android 5.1.1

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

returns aarch64 but it is not 64-bit device!!!

ro.product.cpu.abilist returns armeabi-v7a,armeabi

bool is64Bit =   System.getProperty("ro.product.cpu.abilist").contains("64");

check is the only way to check.

Try System.getProperty("os.arch"). I haven't tried it on 64-bit android, but it must return something like 'aarch64' in case of 64 bit device.