Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:56:20+00:00 2026-06-10T14:56:20+00:00

Possible Duplicate: Is there a unique Android device ID? I used below code to

  • 0

Possible Duplicate:
Is there a unique Android device ID?

I used below code to get android device IMEI and How can I change below code to get android device Unique ID.

String getDeviceID1(TelephonyManager phonyManager){
    String id = phonyManager.getDeviceId();
    if (id == null){
        id = "not available";
    }
    int phoneType = phonyManager.getPhoneType();
    switch(phoneType){
        case TelephonyManager.PHONE_TYPE_NONE:
            return "" + id;

        case TelephonyManager.PHONE_TYPE_GSM:
            return "" + id;

        case TelephonyManager.PHONE_TYPE_CDMA:
            return "" + id;

        /*
        *  for API Level 11 or above
        *  case TelephonyManager.PHONE_TYPE_SIP:
        *   return "SIP";
        */

        default:
            return "" + id;
    }

    //I used to show IMEI 

    TextView textDeviceID = (TextView)findViewById(R.id.deviceid);
    //retrieve a reference to an instance of TelephonyManager
    TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
    textDeviceID.setText(getDeviceID1(telephonyManager));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:56:22+00:00Added an answer on June 10, 2026 at 2:56 pm

    In Android, you can get three different Unique Ids.

    • IMEI ( which you have in your code already )

      TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
      String id =  (getDeviceID1(telephonyManager));
      
    • Device ID

      String android_id = Secure.getString(getContext().getContentResolver(),
                                                      Secure.ANDROID_ID); 
      
    • Bluetooth Address ( this will also be unique for each device )

      private BluetoothAdapter mBtAdapter;
      
      // Get the local Bluetooth adapter
      mBtAdapter = BluetoothAdapter.getDefaultAdapter();
      String deviceMacAddress = mBtAdapter.getAddress();
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Is there a standard date/time format that can be passed on a
Possible Duplicate: Is there a tool that can display a SVN repository visually (
Possible Duplicate: How to get a unique computer identifier in Java (like disk id
Possible Duplicate: getline not asking for input? There is some unique thing happening in
Possible Duplicate: Specifying an index (non unique key) using JPA Is there a way
Possible Duplicate: PHP: How to generate a random, unique, alphanumeric string? I wish to
Possible Duplicate: Array unique values Get unique results from JSON array using jQuery Im
Possible Duplicate: Generate a unique value for a combination of two numbers Is there
Possible Duplicate: PHP: How to generate a random, unique, alphanumeric string? I'm trying to
Possible Duplicate: How can I get the MAC and the IP address of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.