1. Download our Official Android App: Forums for Android!

Apps help me to display string ?

Discussion in 'Android Development' started by achilles205, Aug 22, 2011.

  1. achilles205

    achilles205 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Aug 4, 2011

    Aug 4, 2011
    5
    0
    5
    I'm a newbie in android, i want to find serial number of a android device ... Somebody can help me to display string "deviceId" ? Thank for your help :)
    ---------------------------
    final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHON Y_SERVICE);
    final String tmDevice, tmSerial, tmPhone, androidId;
    tmDevice = "" + tm.getDeviceId();
    tmSerial = "" + tm.getSimSerialNumber();
    androidId = "" + android.provider.Settings.Secure.getString(getCont entResolver(), android.provider.Settings.Secure.ANDROID_ID);

    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
    String deviceId = deviceUuid.toString();
     

    Advertisement

Share This Page

Loading...