API调用来获取处理器架构架构、处理器、API

由网友(雅墨)分享简介:由于我的应用程序的一部分,我使用NDK,想知道它是否值得捆绑销售的x86和MIPS的二进制文件沿着标准的ARM二进制文件。As part of my app I'm using the NDK and was wondering if it's worth bundling x86 and mips binaries...

由于我的应用程序的一部分,我使用NDK,想知道它是否值得捆绑销售的x86和MIPS的二进制文件沿着标准的ARM二进制文件。

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.

我想最好的办法是什么追踪我的用户确实有,是有一个API调用抢处理器架构,所以我可以通过这回我的谷歌分析实例?

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?

感谢

推荐答案

其实,你可以拿到架构,而不需要反思都:

Actually, you can get the architecture without the need for reflexion at all:

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

这是我的测试中,它返回 armv71 的i686

From my tests it returned armv71 and i686.

编辑:

在MIPS架构,它要么返回MIPS或MIPS64

On MIPS architecture, it either returns 'mips' or 'mips64'

在64位ARM /英特尔,它分别返回arch64'或'x86_64的。

On 64 bit ARM/Intel, it returns 'arch64' or 'x86_64' respectively.

阅读全文

相关推荐

最新文章