Java Code Examples for android.os.Build#HOST

The following examples show how to use android.os.Build#HOST . 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: 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 2
private static String getHandSetInfo() {
    String handSetInfo = "手机型号:" + Build.MODEL
            + "\n系统版本:" + Build.VERSION.RELEASE
            + "\n产品型号:" + Build.PRODUCT
            + "\n版本显示:" + Build.DISPLAY
            + "\n系统定制商:" + Build.BRAND
            + "\n设备参数:" + Build.DEVICE
            + "\n开发代号:" + Build.VERSION.CODENAME
            + "\nSDK版本号:" + Build.VERSION.SDK_INT
            + "\nCPU类型:" + Build.CPU_ABI
            + "\n硬件类型:" + Build.HARDWARE
            + "\n主机:" + Build.HOST
            + "\n生产ID:" + Build.ID
            + "\nROM制造商:" + Build.MANUFACTURER // 这行返回的是rom定制商的名称
            ;
    Log.e("tt",handSetInfo);
    return handSetInfo;
}
 
Example 3
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 4
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 5
@SuppressWarnings("deprecation")
   public static String getLogHeader(String dumpReason, int seqNo) {
	final String Sep = "-";
	StringBuilder write = new StringBuilder("<?xml version=\"1.0\"?>" + "<logs>");
	write.append("<info>");
	StringBuilder infoBlock = new StringBuilder();
	String hostInfo = Build.BRAND + Sep + Build.MANUFACTURER + Sep + Build.MODEL + "(" + Build.HOST + ")";
	infoBlock.append("<host>").append(SdlTrace.B64EncodeForXML(hostInfo)).append("</host>");
	String osv = Build.VERSION.RELEASE + " (" + Build.VERSION.CODENAME + ")";
	infoBlock.append("<osv>").append(SdlTrace.B64EncodeForXML(osv)).append("</osv>");
	infoBlock.append(TraceDeviceInfo.getTelephonyHeader());

	long heapSize = Debug.getNativeHeapFreeSize() / 1024;
	long heapAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
	infoBlock.append("<mem><hf>").append(heapSize).append("KB</hf><ha>").append(heapAllocated).append("KB</ha></mem>");
	infoBlock.append("<np>").append(Runtime.getRuntime().availableProcessors()).append("</np>");
	infoBlock.append("<pid>").append(Process.myPid()).append("</pid>");
	infoBlock.append("<tid>").append(Thread.currentThread().getId()).append("</tid>");

	// String dateStamp = (String)
	// DateFormat.format("yy-MM-dd hh:mm:ss SSS", new Timestamp(baseTics));
	Timestamp stamp = new Timestamp(SdlTrace.getBaseTics());
	String GMTtime = stamp.toGMTString().substring(0, 19);
	long fracSec = stamp.getNanos() / 1000000; // divide by a million
	String fracSecStr = String.format("%03d", fracSec);
	infoBlock.append("<utc>").append(GMTtime).append(".").append(fracSecStr).append("</utc>");

	infoBlock.append(TraceDeviceInfo.getLogHeaderBluetoothPairs());
	infoBlock.append(getSmartDeviceLinkTraceRoot(dumpReason, seqNo));

	write.append(infoBlock);

	write.append("</info>" + "<msgs>");
	return write.toString();
}
 
Example 6
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 7
Source Project: XPrivacy   File: Hook.java    License: GNU General Public License v3.0 5 votes vote down vote up
public static boolean isAOSP(int sdk) {
	if (!PrivacyManager.cVersion3)
		return false;
	if (Build.VERSION.SDK_INT >= sdk) {
		if ("true".equals(System.getenv("XPrivacy.AOSP")))
			return true;
		if (Build.DISPLAY == null || Build.HOST == null)
			return false;
		if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
			// @formatter:off
			return (
					isAOSP() ||
					isCyanogenMod() ||
					isOmni() ||
					isMIUI() ||
					isSlim() ||
					isParanoidAndroid() ||
					isCarbon() ||
					isDirtyUnicorns() ||
					isLiquidSmooth() ||
					isAndroidRevolutionHD() ||
					isMahdi() ||
					isOmega()
				);
		// @formatter:on
		else
			return isAOSP();
	} else
		return false;
}
 
Example 8
Source Project: unity-ads-android   File: Device.java    License: Apache License 2.0 4 votes vote down vote up
public static String getHost () {
	return Build.HOST;
}
 
Example 9
@ReactMethod(isBlockingSynchronousMethod = true)
public String getHostSync() { return Build.HOST; }
 
Example 10
Source Project: DevUtils   File: DeviceUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * 获取设备主机地址
 * @return 设备主机地址
 */
public static String getHost() {
    return Build.HOST;
}