Java Code Examples for android.os.Build#BOARD

The following examples show how to use android.os.Build#BOARD . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: BlogDemo   File: FindEmulator.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean hasEmulatorBuild(Context context) {
    String BOARD = Build.BOARD; // The name of the underlying board, like "unknown".
    // This appears to occur often on real hardware... that's sad
    // String BOOTLOADER = android.os.Build.BOOTLOADER; // The system bootloader version number.
    String BRAND = Build.BRAND; // The brand (e.g., carrier) the software is customized for, if any.
    // "generic"
    String DEVICE = Build.DEVICE; // The name of the industrial design. "generic"
    String HARDWARE = Build.HARDWARE; // The name of the hardware (from the kernel command line or
    // /proc). "goldfish"
    String MODEL = Build.MODEL; // The end-user-visible name for the end product. "sdk"
    String PRODUCT = Build.PRODUCT; // The name of the overall product.
    if ((BOARD.compareTo("unknown") == 0) /* || (BOOTLOADER.compareTo("unknown") == 0) */
            || (BRAND.compareTo("generic") == 0) || (DEVICE.compareTo("generic") == 0)
            || (MODEL.compareTo("sdk") == 0) || (PRODUCT.compareTo("sdk") == 0)
            || (HARDWARE.compareTo("goldfish") == 0)) {
        return true;
    }
    return false;
}
 
Example 2
Source Project: Android   File: SignupFragment.java    License: MIT License 6 votes vote down vote up
private void getDetailsMANUFACTURER() {
    //==============================
    Field[] fields = Build.VERSION_CODES.class.getFields();
    String osName = fields[Build.VERSION.SDK_INT + 1].getName();
    ////===============================
    Details_MANUFACTURER =
            "SERIAL: " + Build.SERIAL + "\n" +
                    "MODEL: " + Build.MODEL + "\n" +
                    "ID: " + Build.ID + "\n" +
                    "Manufacture: " + Build.MANUFACTURER + "\n" +
                    "Brand: " + Build.BRAND + "\n" +
                    "Type: " + Build.TYPE + "\n" +
                    "User: " + Build.USER + "\n" +
                    "BASE: " + Build.VERSION_CODES.BASE + "\n" +
                    "INCREMENTAL: " + Build.VERSION.INCREMENTAL + "\n" +
                    "SDK:  " + Build.VERSION.SDK +" OS:"+osName+ "\n" +
                    "BOARD: " + Build.BOARD + "\n" +
                    "BRAND: " + Build.BRAND + "\n" +
                    "HOST: " + Build.HOST + "\n" +
                    "FINGERPRINT: " + Build.FINGERPRINT + "\n" +
                    "Version Code: " + Build.VERSION.RELEASE +
                    "Display : " + Build.DISPLAY;
    //Log.e("TAG",Details_MANUFACTURER);
}
 
Example 3
public SystemInfo getInfo() {
  boolean isProbablyAnEmulator = Build.FINGERPRINT.startsWith("generic")
      || Build.FINGERPRINT.startsWith("unknown")
      || Build.MODEL.contains("google_sdk")
      || Build.MODEL.contains("Emulator")
      || Build.MODEL.contains("Android SDK built for x86")
      || Build.BOARD == "QC_Reference_Phone" //bluestacks
      || Build.MANUFACTURER.contains("Genymotion")
      || Build.HOST.startsWith("Build") //MSI App Player
      || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
      || "google_sdk" == Build.PRODUCT;
  SystemInfo result = new SystemInfo();
  result.setBrand(Build.BRAND);
  result.setManufacturer(Build.MANUFACTURER);
  result.setModel(Build.MODEL);
  result.setOsAPILevel(Build.VERSION.SDK_INT);
  result.setOsCodeName(Build.VERSION.CODENAME);
  result.setRunOnEmulator(isProbablyAnEmulator);
  return result;
}
 
Example 4
private void recordInformations(Context context) {
	try {
		PackageManager pm = context.getPackageManager();
		PackageInfo pi;
		// Version
		pi = pm.getPackageInfo(context.getPackageName(), 0);
		versionName = pi.versionName;
		//buildNumber = currentVersionNumber(context);
		// Package name
		packageName = pi.packageName;

		// Device model
		phoneModel = Build.MODEL;
		// Android version
		androidVersion = Build.VERSION.RELEASE;

		board = Build.BOARD;
		brand = Build.BRAND;
		device = Build.DEVICE;
		display = Build.DISPLAY;
		fingerPrint = Build.FINGERPRINT;
		host = Build.HOST;
		id = Build.ID;
		model = Build.MODEL;
		product = Build.PRODUCT;
		manufacturer = Build.MANUFACTURER;
		tags = Build.TAGS;
		time = Build.TIME;
		type = Build.TYPE;
		user = Build.USER;

	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 5
private static boolean isPhone(String[] boards) {
    final String board = Build.BOARD;
    if (board == null) {
        return false;
    }
    for (String board1 : boards) {
        if (board.equals(board1)) {
            return true;
        }
    }
    return false;
}
 
Example 6
@CalledByNative
private static String[] getAll() {
    BuildInfo buildInfo = getInstance();
    String hostPackageName = ContextUtils.getApplicationContext().getPackageName();
    return new String[] {
            Build.BRAND, Build.DEVICE, Build.ID, Build.MANUFACTURER, Build.MODEL,
            String.valueOf(Build.VERSION.SDK_INT), Build.TYPE, Build.BOARD, hostPackageName,
            String.valueOf(buildInfo.hostVersionCode), buildInfo.hostPackageLabel,
            buildInfo.packageName, String.valueOf(buildInfo.versionCode), buildInfo.versionName,
            buildInfo.androidBuildFingerprint, buildInfo.gmsVersionCode,
            buildInfo.installerPackageName, buildInfo.abiString, BuildConfig.FIREBASE_APP_ID,
            buildInfo.customThemes, buildInfo.resourcesVersion, buildInfo.extractedFileSuffix,
    };
}
 
Example 7
Source Project: CrashReporter   File: AppUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String getDeviceDetails(Context context) {

        return "Device Information\n"
                + "\nDEVICE.ID : " + getDeviceId(context)
                + "\nUSER.ID : " + getUserIdentity(context)
                + "\nAPP.VERSION : " + getAppVersion(context)
                + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context)
                + "\nTIMEZONE : " + timeZone()
                + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE
                + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL
                + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT
                + "\nBOARD : " + Build.BOARD
                + "\nBOOTLOADER : " + Build.BOOTLOADER
                + "\nBRAND : " + Build.BRAND
                + "\nCPU_ABI : " + Build.CPU_ABI
                + "\nCPU_ABI2 : " + Build.CPU_ABI2
                + "\nDISPLAY : " + Build.DISPLAY
                + "\nFINGERPRINT : " + Build.FINGERPRINT
                + "\nHARDWARE : " + Build.HARDWARE
                + "\nHOST : " + Build.HOST
                + "\nID : " + Build.ID
                + "\nMANUFACTURER : " + Build.MANUFACTURER
                + "\nMODEL : " + Build.MODEL
                + "\nPRODUCT : " + Build.PRODUCT
                + "\nSERIAL : " + Build.SERIAL
                + "\nTAGS : " + Build.TAGS
                + "\nTIME : " + Build.TIME
                + "\nTYPE : " + Build.TYPE
                + "\nUNKNOWN : " + Build.UNKNOWN
                + "\nUSER : " + Build.USER;
    }
 
Example 8
Source Project: DoingDaily   File: DeviceUtil.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 获取手机厂商
 *
 * @return 当前手机生产厂商
 */
public static final String getBoard() {
    if (Build.BOARD != null) {
        return Build.BOARD;
    }
    return "unKnown";
}
 
Example 9
Source Project: IPTVFree   File: Utils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Get system information for bug report
 * @return String
 */
public static String getSystemInformation()
{
    return  "SDK: " + Build.VERSION.SDK_INT + "\n" +
            "RELEASE: " + Build.VERSION.RELEASE + "\n" +
            "DEVICE: " + Build.DEVICE + "\n" +
            "OS VERSION: " + System.getProperty("os.version") + "\n" +
            "OS NAME: " + System.getProperty("os.name") + "\n" +
            "MODEL: " + Build.MODEL + "\n" +
            "PRODUCT: " + Build.PRODUCT + "\n"+
            "BRAND: " + Build.BRAND + "\n" +
            "HARDWARE: " + Build.HARDWARE + "\n" +
            "BOARD: " + Build.BOARD + "\n";
}
 
Example 10
public Error(PackageInfo packageinfo, Throwable exception) {
    packagename = packageinfo.packageName;
    versionname = packageinfo.versionName;
    versioncode = Integer.toString(packageinfo.versionCode);
    model = Build.MODEL;
    androidversion = Build.VERSION.RELEASE;
    board = Build.BOARD;
    device = Build.DEVICE;
    brand = Build.BRAND;
    stacktrace = getStacktrace(exception);
}
 
Example 11
private UUID generateDeviceUuid(Context context) {

		// Get some of the hardware information
		String buildParams = Build.BOARD + Build.BRAND + Build.CPU_ABI
				+ Build.DEVICE + Build.DISPLAY + Build.FINGERPRINT + Build.HOST
				+ Build.ID + Build.MANUFACTURER + Build.MODEL + Build.PRODUCT
				+ Build.TAGS + Build.TYPE + Build.USER;

		// Requires READ_PHONE_STATE
		TelephonyManager tm = (TelephonyManager) context
				.getSystemService(Context.TELEPHONY_SERVICE);

		// gets the imei (GSM) or MEID/ESN (CDMA)
		String imei = tm.getDeviceId();

		// gets the android-assigned id
		String androidId = Secure.getString(context.getContentResolver(),
				Secure.ANDROID_ID);

		// requires ACCESS_WIFI_STATE
		WifiManager wm = (WifiManager) context
				.getSystemService(Context.WIFI_SERVICE);

		// gets the MAC address
		String mac = wm.getConnectionInfo().getMacAddress();

		// if we've got nothing, return a random UUID
		if (isEmpty(imei) && isEmpty(androidId) && isEmpty(mac)) {
			return UUID.randomUUID();
		}

		// concatenate the string
		String fullHash = buildParams.toString() + imei + androidId + mac;

		return UUID.nameUUIDFromBytes(fullHash.getBytes());
	}
 
Example 12
Source Project: Box   File: DeviceUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static String getBoard() {
    return Build.BOARD;
}
 
Example 13
private String collectInfo() {
    String info;
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        info = "BRAND " + Build.BRAND + (char) 10 +
                "MODEL " + Build.MODEL + (char) 10 +
                "MANUFACTURER " + Build.MANUFACTURER + (char) 10 +
                "PRODUCT " + Build.PRODUCT + (char) 10 +
                "DEVICE " + Build.DEVICE + (char) 10 +
                "BOARD " + Build.BOARD + (char) 10 +
                "HARDWARE " + Build.HARDWARE + (char) 10 +
                "SUPPORTED_ABIS " + Arrays.toString(Build.SUPPORTED_ABIS) + (char) 10 +
                "SUPPORTED_32_BIT_ABIS " + Arrays.toString(Build.SUPPORTED_32_BIT_ABIS) + (char) 10 +
                "SUPPORTED_64_BIT_ABIS " + Arrays.toString(Build.SUPPORTED_64_BIT_ABIS) + (char) 10 +
                "SDK_INT " + Build.VERSION.SDK_INT + (char) 10 +
                "APP_VERSION_CODE " + BuildConfig.VERSION_CODE + (char) 10 +
                "APP_VERSION_NAME " + BuildConfig.VERSION_NAME + (char) 10 +
                "APP_PROC_VERSION " + TopFragment.appProcVersion + (char) 10 +
                "CAN_FILTER " + Util.canFilter(this) + (char) 10 +
                "APP_VERSION " + TopFragment.appVersion + (char) 10 +
                "DNSCRYPT_INTERNAL_VERSION " + TopFragment.DNSCryptVersion + (char) 10 +
                "TOR_INTERNAL_VERSION " + TopFragment.TorVersion + (char) 10 +
                "I2PD_INTERNAL_VERSION " + TopFragment.ITPDVersion + (char) 10 +
                "SIGN_VERSION " + TopFragment.appSign;
    } else {
        info = "BRAND " + Build.BRAND + (char) 10 +
                "MODEL " + Build.MODEL + (char) 10 +
                "MANUFACTURER " + Build.MANUFACTURER + (char) 10 +
                "PRODUCT " + Build.PRODUCT + (char) 10 +
                "DEVICE " + Build.DEVICE + (char) 10 +
                "BOARD " + Build.BOARD + (char) 10 +
                "HARDWARE " + Build.HARDWARE + (char) 10 +
                "SDK_INT " + Build.VERSION.SDK_INT + (char) 10 +
                "APP_VERSION_CODE " + BuildConfig.VERSION_CODE + (char) 10 +
                "APP_VERSION_NAME " + BuildConfig.VERSION_NAME + (char) 10 +
                "APP_PROC_VERSION " + TopFragment.appProcVersion + (char) 10 +
                "CAN_FILTER " + Util.canFilter(this) + (char) 10 +
                "APP_VERSION " + TopFragment.appVersion + (char) 10 +
                "DNSCRYPT_INTERNAL_VERSION " + TopFragment.DNSCryptVersion + (char) 10 +
                "TOR_INTERNAL_VERSION " + TopFragment.TorVersion + (char) 10 +
                "I2PD_INTERNAL_VERSION " + TopFragment.ITPDVersion + (char) 10 +
                "SIGN_VERSION " + TopFragment.appSign;
    }

    return info;
}
 
Example 14
Source Project: Box   File: DeviceUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static String getBoard() {
    return Build.BOARD;
}
 
Example 15
@Override
public void uncaughtException(Thread t, Throwable e) {
    e.printStackTrace();
    String crashTime =
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault())
                    .format(new Date());
    String env =
            "########RuntimeEnviormentInormation#######\n" +
                    "crashTime = " + crashTime + "\n" +
                    "model = " + Build.MODEL + "\n" +
                    "android = " + Build.VERSION.RELEASE + "(" + Build.VERSION.SDK_INT + ")\n" +
                    "brand = " + Build.BRAND + "\n" +
                    "manufacturer = " + Build.MANUFACTURER + "\n" +
                    "board = " + Build.BOARD + "\n" +
                    "hardware = " + Build.HARDWARE + "\n" +
                    "device = " + Build.DEVICE + "\n" +
                    "version = " + getVersionName() + "(" + getVersionCode() + ")\n" +
                    "supportAbis = " + getSupportAbis() + "\n" +
                    "display = " + Build.DISPLAY + "\n";
    Writer writer = new StringWriter();
    PrintWriter printWriter = new PrintWriter(writer);
    e.printStackTrace(printWriter);
    Throwable cause = e.getCause();
    while (cause != null) {
        cause.printStackTrace(printWriter);
        cause = cause.getCause();
    }
    printWriter.close();
    String stack = "############ForceCloseCrashLog############\n" + writer.toString();
    String message = env + stack;
    try {
        String name = "error_log_" + crashTime + ".log";
        FileOutputStream fos =
                new FileOutputStream(new File(mContext.getExternalFilesDir("logs"), name));
        fos.write(message.getBytes());
        fos.close();
    } catch (IOException ex) {
        ex.printStackTrace();
    }

    Process.killProcess(Process.myPid());
    System.exit(1);
}
 
Example 16
Source Project: unity-ads-android   File: Device.java    License: Apache License 2.0 4 votes vote down vote up
public static String getBoard () {
	return Build.BOARD;
}
 
Example 17
public RaygunEnvironmentMessage(Context context) {
    try {
        architecture = Build.CPU_ABI;
        oSVersion = Build.VERSION.RELEASE;
        osSDKVersion = Integer.toString(Build.VERSION.SDK_INT);
        deviceName = Build.MODEL;
        deviceCode = Build.DEVICE;
        brand = Build.BRAND;
        board = Build.BOARD;

        processorCount = Runtime.getRuntime().availableProcessors();

        int orientation = context.getResources().getConfiguration().orientation;
        if (orientation == 1) {
            currentOrientation = "Portrait";
        } else if (orientation == 2) {
            currentOrientation = "Landscape";
        } else if (orientation == 3) {
            currentOrientation = "Square";
        } else {
            currentOrientation = "Undefined";
        }

        DisplayMetrics metrics = new DisplayMetrics();
        ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics);
        windowsBoundWidth = metrics.widthPixels;
        windowsBoundHeight = metrics.heightPixels;

        TimeZone tz = TimeZone.getDefault();
        Date now = new Date();
        utcOffset = TimeUnit.SECONDS.convert(tz.getOffset(now.getTime()), TimeUnit.MILLISECONDS) / 3600;
        locale = context.getResources().getConfiguration().locale.toString();

        ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        am.getMemoryInfo(mi);
        availablePhysicalMemory = mi.availMem / 0x100000;

        Pattern p = Pattern.compile("^\\D*(\\d*).*$");
        Matcher m = p.matcher(getTotalRam());
        m.find();
        String match = m.group(1);
        totalPhysicalMemory = Long.parseLong(match) / 0x400;

        StatFs stat = new StatFs(Environment.getDataDirectory().getPath());

        long availableBlocks = (long) stat.getAvailableBlocks();
        long blockSize = (long) stat.getBlockSize();
        diskSpaceFree = (availableBlocks * blockSize) / 0x100000;
    } catch (Exception e) {
        RaygunLogger.w("Couldn't get all env data: " + e);
    }
}
 
Example 18
Source Project: Android-utils   File: DeviceUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * 获取主板信息
 *
 * @return 主板信息
 */
public static String getBoard() {
    return Build.BOARD;
}
 
Example 19
Source Project: imsdk-android   File: DeviceUtil.java    License: MIT License 2 votes vote down vote up
/**
 * 设备厂商
 *
 * @return
 */
public static String getPhoneBrand() {
    return Build.BOARD + "  " + Build.MANUFACTURER;
}
 
Example 20
Source Project: DevUtils   File: DeviceUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * 获取设备基板名称
 * @return 设备基板名称
 */
public static String getBoard() {
    return Build.BOARD;
}