API call to get processor architecture

后端 未结 8 2026
野的像风
野的像风 2020-12-05 01:59

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.

I figured the best way woul

8条回答
  •  独厮守ぢ
    2020-12-05 03:05

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

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

    From my tests it returned armv71 and i686.

    EDIT:

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

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

提交回复
热议问题