get CPU ABI2 - Android Hardware

Android examples for Hardware:CPU Information

Description

get CPU ABI2

Demo Code


//package com.book2s;
import java.lang.reflect.Field;
import android.os.Build;

public class Main {
    public static final String get_CPU_ABI2() {
        try {// ww w  .  j ava2s.c o m
            Field field = Build.class.getDeclaredField("CPU_ABI2");
            if (field == null)
                return null;

            Object fieldValue = field.get(null);
            if (field == null || !(fieldValue instanceof String)) {
                return null;
            }

            return (String) fieldValue;
        } catch (Exception e) {

        }

        return null;
    }
}

Related Tutorials