API调用来获取处理器架构 [英] API call to get processor architecture

查看:278
本文介绍了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 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.

这篇关于API调用来获取处理器架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆