API call to get processor architecture

后端 未结 8 2054
野的像风
野的像风 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 02:52

    My Code looks like this

    private String cpuinfo()
    {
    String arch = System.getProperty("os.arch");    
    String arc = arch.substring(0, 3).toUpperCase();
    String rarc="";
    if (arc.equals("ARM")) {
        rarc= "This is ARM";
        }else if (arc.equals("MIP")){
            rarc= "This is MIPS";
        }else if (arc.equals("X86")){
            rarc= "This is X86";
        }
        return rarc;
    }
    

提交回复
热议问题