CPU support MIPS - Android Hardware

Android examples for Hardware:CPU Information

Description

CPU support MIPS

Demo Code


//package com.book2s;
import java.lang.reflect.Field;

import android.os.Build;
import android.text.TextUtils;

public class Main {
    public static boolean supportMIPS() {
        return supportABI("mips");
    }//ww  w .  j  ava 2s.c  om

    public static boolean supportABI(String paramString) {
        String str = get_CPU_ABI();
        if ((!TextUtils.isEmpty(str))
                && (str.equalsIgnoreCase(paramString))) {
        }
        while ((!TextUtils.isEmpty(get_CPU_ABI2()))
                && (str.equalsIgnoreCase(paramString))) {
            return true;
        }
        return false;
    }

    public static final String get_CPU_ABI() {
        return Build.CPU_ABI;
    }

    public static final String get_CPU_ABI2() {
        try {
            Field localField = Build.class.getDeclaredField("CPU_ABI2");
            if (localField == null) {
                return null;
            }
            Object localObject = localField.get(null);
            if ((localField != null) && ((localObject instanceof String))) {
                String str = (String) localObject;
                return str;
            }
        } catch (Exception localException) {
            return null;
        }
        return null;
    }
}

Related Tutorials