How to get the Device ID


How to get the device ID


The developers and the testers are increasingly finding it difficult to develop and test secure mobile applications. With the recent growth in the mobile space people are prone to lose their private data due to security loop homes in the hand held devices. Hence the use of device ID's are vital to reduce the impact of the security concerns.

All the major smart phone device manufacturers like Apple, Samsung, HTC, Motorolla are using the device ID's to track it.

What is a Device ID?

The Device ID is unique to your handheld device. The Device ID is not the serial number of your Device. While downloading the applications from the app stores device ID plays a major role it.

How to find the device ID in a hand help device?

Here are some of the ways to find out your devices ID on various devices.

1) Using third party applications to find the device ID

There are several third party applications, which are available on the app stores (Android Play, iTunes, etc..), which can be downloaded for free. The actual purpose of the application may be different, however they could be used to view the device ID of the application. Please find below the steps to get the device ID of your device.

Device ID on iPhone/iPad/iPod Touch or Blackberry Device:

  • Download and install Skyscape application on your devices
  • Open Skyscape on your new device
  • Tap on Tools --> About

 Device ID on an Android Device:

  • Download and install Skyscape application on your devices
  • Open Skyscape on your new device
  • Tap on the Tools tab
  • Choose About

 Device id on a Palm:

  • Download and install Skyscape application on your devices
  • Open the product.
  • Go to the main index of the product.
  • Tap on the product title in the upper left of the screen.
  • Choose Register - the device ID is listed on this screen.

 Device ID on a Pocket PC OS device:

    Download and install Skyscape application on your devices
    Open the product.
    Go to the main index of the product - Tap on the Yellow index icon.
    Tap on Help.
    Tap on Register - the Device ID is listed on this screen.


2) Programatically get device ID for Android devices:


Here is sample Code to get UDID

public class DemoActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    TelephonyManager tm = (TelephonyManager)           this.getSystemService(Context.TELEPHONY_SERVICE);
    Log.d("ID", "Android ID: " + Secure.getString(getContentResolver(), Secure.ANDROID_ID));
    Log.d("ID", "Device ID : " + tm.getDeviceId());
}
}

For getting Device ID you have to set following permission in AndroidMenifest.xml

   

For getting ANDROID_ID you don't need to set any permission.


Join our community in Facebook and Google+ at the below URL's to stay up to date:


Facebook Page: http://www.facebook.com/SoftwareQaHelp
Google+ : https://plus.google.com/101680718973348361876



No comments:

Post a Comment