List of usage examples for android.os Build BOARD
String BOARD
To view the source code for android.os Build BOARD.
Click Source Link
From source file:Main.java
/** * Checks whether or not the running device is an emulator. * // w ww. j a v a 2 s . c o m * @return Boolean indicating if the app is currently running in an * emulator. */ public static boolean isEmulator() { return (Build.BOARD.equals("unknown") && Build.DEVICE.equals("generic") && Build.BRAND.equals("generic")); }
From source file:Main.java
public static String collectStats(CharSequence flattenedParams) { StringBuilder result = new StringBuilder(1000); result.append("BOARD=").append(Build.BOARD).append('\n'); result.append("BRAND=").append(Build.BRAND).append('\n'); result.append("CPU_ABI=").append(Build.CPU_ABI).append('\n'); result.append("DEVICE=").append(Build.DEVICE).append('\n'); result.append("DISPLAY=").append(Build.DISPLAY).append('\n'); result.append("FINGERPRINT=").append(Build.FINGERPRINT).append('\n'); result.append("HOST=").append(Build.HOST).append('\n'); result.append("ID=").append(Build.ID).append('\n'); result.append("MANUFACTURER=").append(Build.MANUFACTURER).append('\n'); result.append("MODEL=").append(Build.MODEL).append('\n'); result.append("PRODUCT=").append(Build.PRODUCT).append('\n'); result.append("TAGS=").append(Build.TAGS).append('\n'); result.append("TIME=").append(Build.TIME).append('\n'); result.append("TYPE=").append(Build.TYPE).append('\n'); result.append("USER=").append(Build.USER).append('\n'); result.append("VERSION.CODENAME=").append(Build.VERSION.CODENAME).append('\n'); result.append("VERSION.INCREMENTAL=").append(Build.VERSION.INCREMENTAL).append('\n'); result.append("VERSION.RELEASE=").append(Build.VERSION.RELEASE).append('\n'); result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n'); if (flattenedParams != null) { String[] params = SEMICOLON.split(flattenedParams); Arrays.sort(params);/*from w ww.j av a2 s. com*/ for (String param : params) { result.append(param).append('\n'); } } return result.toString(); }
From source file:Main.java
public static String getDeviceId(Context context) { // IMEI, if present TelephonyManager telephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String imei = telephonyMgr.getDeviceId(); // Requires READ_PHONE_STATE if (imei != null) return imei; String devId = "35" + //we make this look like a valid IMEI Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; //13 digits return devId; }
From source file:cc.softwarefactory.lokki.android.utilities.Utils.java
public static String getDeviceId() { return "35" + //we make this look like a valid IMEI Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.SERIAL.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; //13 digits }
From source file:crow.util.Util.java
/** * ???//from w ww. ja v a 2 s . c om * * @return true ? false ? */ public static boolean isEmulator() { return ("unknown".equals(Build.BOARD)) && ("generic".equals(Build.DEVICE)) && ("generic".equals(Build.BRAND)); }
From source file:com.prey.PreyPhone.java
private void updateHardware() { Map<String, String> mapData = getProcessorData(); hardware = new Hardware(); hardware.setUuid(getUuid());/*from w w w.j ava 2 s. co m*/ hardware.setAndroidDeviceId(getAndroidDeviceId()); hardware.setBiosVendor(Build.MANUFACTURER); hardware.setBiosVersion(mapData.get("Revision")); hardware.setMbVendor(Build.MANUFACTURER); // hardware.setMbVersion(Build.BOOTLOADER ); hardware.setMbModel(Build.BOARD); //hardware.setMbVersion(mbVersion); hardware.setCpuModel(mapData.get("Processor")); hardware.setCpuSpeed(String.valueOf(maxCPUFreqMHz())); hardware.setCpuCores(String.valueOf(getCpuCores())); hardware.setRamSize(String.valueOf(getMemoryRamSize())); // hardware.setRamModules(ramModules); hardware.setSerialNumber(getSerialNumber()); initMemory(); }
From source file:org.LK8000.LK8000.java
@Override protected void onCreate(Bundle savedInstanceState) { if (serviceClass == null) serviceClass = MyService.class; super.onCreate(savedInstanceState); // Fabric.with(this, new Crashlytics(), new CrashlyticsNdk()); Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics(), new CrashlyticsNdk()) .build();// ww w . ja v a2 s .c o m Fabric.with(fabric); Log.d(TAG, "ABI=" + Build.CPU_ABI); Log.d(TAG, "PRODUCT=" + Build.PRODUCT); Log.d(TAG, "MANUFACTURER=" + Build.MANUFACTURER); Log.d(TAG, "MODEL=" + Build.MODEL); Log.d(TAG, "DEVICE=" + Build.DEVICE); Log.d(TAG, "BOARD=" + Build.BOARD); Log.d(TAG, "FINGERPRINT=" + Build.FINGERPRINT); if (!Loader.loaded) { TextView tv = new TextView(this); tv.setText("Failed to load the native LK8000 libary.\n" + "Report this problem to us, and include the following information:\n" + "ABI=" + Build.CPU_ABI + "\n" + "PRODUCT=" + Build.PRODUCT + "\n" + "FINGERPRINT=" + Build.FINGERPRINT + "\n" + "error=" + Loader.error); setContentView(tv); return; } initialiseNative(); NetUtil.initialise(this); InternalGPS.Initialize(); NonGPSSensors.Initialize(); IOIOHelper.onCreateContext(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) // Bluetooth suppoert was added in Android 2.0 "Eclair" BluetoothHelper.Initialize(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) // the DownloadManager was added in Android 2.3 "Gingerbread" DownloadUtil.Initialise(getApplicationContext()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { UsbSerialHelper.Initialise(this); } SoundUtil.Initialise(); // fullscreen mode requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); /* Workaround for layout problems in Android KitKat with immersive full screen mode: Sometimes the content view was not initialized with the correct size, which caused graphics artifacts. */ if (android.os.Build.VERSION.SDK_INT >= 19) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } enableImmersiveModeIfSupported(); TextView tv = new TextView(this); tv.setText("Loading LK8000..."); setContentView(tv); batteryReceiver = new BatteryReceiver(); registerReceiver(batteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); SharedPreferences settings = getSharedPreferences("LK8000", 0); int screenOrientation = settings.getInt("screenOrientation", 0); switch (screenOrientation) { case 0: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); break; case 1: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); break; case 2: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); break; case 3: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); break; case 4: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); break; default: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); } getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }
From source file:at.amartinz.hardware.device.Device.java
protected Device(@NonNull Context context) { mContext = context;//from w w w .j a v a2 s . c o m platformVersion = Build.VERSION.RELEASE; platformId = Build.DISPLAY; platformType = Build.VERSION.CODENAME + " " + Build.TYPE; platformTags = Build.TAGS; platformBuildType = HwUtils.getDate(Build.TIME); vmVersion = System.getProperty("java.vm.version", "-"); vmLibrary = getRuntime(); final Resources res = context.getResources(); screenWidth = res.getDisplayMetrics().widthPixels; screenHeight = res.getDisplayMetrics().heightPixels; androidId = getAndroidId(context); manufacturer = Build.MANUFACTURER; model = Build.MODEL; device = Build.DEVICE; product = Build.PRODUCT; board = Build.BOARD; bootloader = Build.BOOTLOADER; radio = Build.getRadioVersion(); // initialize defaults hasBusyBox = false; hasRoot = false; suVersion = "-"; isSELinuxEnforcing = isSELinuxEnforcing(); // ehm, alright, if you say so... }
From source file:com.apptentive.android.sdk.storage.DeviceManager.java
private static Device generateNewDevice(Context context) { Device device = new Device(); // First, get all the information we can load from static resources. device.setOsName("Android"); device.setOsVersion(Build.VERSION.RELEASE); device.setOsBuild(Build.VERSION.INCREMENTAL); device.setOsApiLevel(String.valueOf(Build.VERSION.SDK_INT)); device.setManufacturer(Build.MANUFACTURER); device.setModel(Build.MODEL);/*from ww w. j a v a2 s .c o m*/ device.setBoard(Build.BOARD); device.setProduct(Build.PRODUCT); device.setBrand(Build.BRAND); device.setCpu(Build.CPU_ABI); device.setDevice(Build.DEVICE); device.setUuid(GlobalInfo.androidId); device.setBuildType(Build.TYPE); device.setBuildId(Build.ID); // Second, set the stuff that requires querying system services. TelephonyManager tm = ((TelephonyManager) (context.getSystemService(Context.TELEPHONY_SERVICE))); device.setCarrier(tm.getSimOperatorName()); device.setCurrentCarrier(tm.getNetworkOperatorName()); device.setNetworkType(Constants.networkTypeAsString(tm.getNetworkType())); // Finally, use reflection to try loading from APIs that are not available on all Android versions. device.setBootloaderVersion(Reflection.getBootloaderVersion()); device.setRadioVersion(Reflection.getRadioVersion()); device.setLocaleCountryCode(Locale.getDefault().getCountry()); device.setLocaleLanguageCode(Locale.getDefault().getLanguage()); device.setLocaleRaw(Locale.getDefault().toString()); device.setUtcOffset(String.valueOf((TimeZone.getDefault().getRawOffset() / 1000))); return device; }
From source file:altermarkive.uploader.Report.java
private static JSONObject reportDevice(Context context) throws JSONException { JSONObject device = new JSONObject(); device.put("id", hash(id(context))); device.put("manufacturer", Build.MANUFACTURER); device.put("brand", Build.BRAND); device.put("product", Build.PRODUCT); device.put("model", Build.MODEL); device.put("design", Build.DEVICE); device.put("board", Build.BOARD); device.put("hardware", Build.HARDWARE); device.put("build", Build.FINGERPRINT); return device; }