is NEON - Android android.system

Android examples for android.system:Os Version

Description

is NEON

Demo Code

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Main {

  public static boolean isNEON() {
    boolean isNEON = false;
    String cupinfo = getCPUInfos();
    if (cupinfo != null) {
      cupinfo = cupinfo.toLowerCase();/* ww  w.j  a va 2s  .c  o m*/
      isNEON = cupinfo != null && cupinfo.contains("neon");
    }
    return isNEON;
  }

  @SuppressWarnings("resource")
  private static String getCPUInfos() {
    String str1 = "/proc/cpuinfo";
    String str2 = "";
    StringBuilder resusl = new StringBuilder();
    String resualStr = null;
    try {
      FileReader fr = new FileReader(str1);
      BufferedReader localBufferedReader = new BufferedReader(fr, 8192);
      while ((str2 = localBufferedReader.readLine()) != null) {
        resusl.append(str2);
        // String cup = str2;
      }
      if (resusl != null) {
        resualStr = resusl.toString();
        return resualStr;
      }
    } catch (IOException e) {
    }
    return resualStr;
  }

}

Related Tutorials