Code example for UUID

Methods: toString

0
		// Get unique device ID 
		String tmDevice, tmSerial, androidId;
	    tmDevice = "" + tm.getDeviceId();
	    tmSerial = "" + tm.getSimSerialNumber();
	    androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
	    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
	    deviceId = deviceUuid.toString();
	} 
	 
	public boolean isNetworkAvailable(Context context) {
	    if (connectivity != null) {
	       NetworkInfo[] info = connectivity.getAllNetworkInfo();
	       if (info != null) {
	          for (int i = 0; i < info.length; i++) {
	             if (info[i].getState() == NetworkInfo.State.CONNECTED) {
	                return true; 
	             } 
	          } 
	       } 
	    }  
	    return false;