使用System.getProperty(" os.arch")检查它是否是armeabi cpu

时间:2015-11-13 14:07:15

标签: android cpu-architecture

我在一些旧的4.2.2设备上遇到了以下RenderScript问题(galaxy s3 mini,galaxy ace 3,galaxy fresh等) - Android - Renderscript Support Library - Error loading RS jni library

我想实现建议的解决方案,但

返回的值究竟是什么
  

System.getProperty(" os.arch&#34);

armeabi 设备(不是armeabi-v7设备)。

感谢。

1 个答案:

答案 0 :(得分:10)

方法System.getProperty是Java的通用方法,here您可以找到文档。

在Linux上,它返回从命令uname -m获得的相同值。可能的值包括armv5tarmv5tearmv5tejarmv5tejlarmv6armv7armv7l,{{ 1}}还有更多。 i686设备没有确切的值,因为它与cpu略有不同。

armeabi有一个更好的替代方案,它是System.getProperty字段(或新设备中的Build.CPU_ABI):

Build.SUPPORTED_ABIS

可能的值包括String abi = null; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { abi = Build.CPU_ABI; } else { abi = Build.SUPPORTED_ABIS[0]; } armeabiarmeabi-v7aarm64-v8ax86x86_64mips

正如您所看到的,可能的结果数量远低于mips64,您可以直接查看System.getProperty

相关问题