---
title: "Write code snippet to retrieve IMEI number of Android phone."  
description: "Write code snippet to retrieve IMEI number of Android phone."  
author: "Anonymous User"  
published: 2015-05-27  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/2580/write-code-snippet-to-retrieve-imei-number-of-android-phone  
category: "android"  
tags: ["android"]  
reading_time: 1 minute  

---

# Write code snippet to retrieve IMEI number of Android phone.

TelephonyManager class can be used to get the IMEI number. It provides access to information about the telephony services on the device.

```
TelephonyManager mTelephonyMgr = (TelephonyManager)        getSystemService(Context.TELEPHONY_SERVICE);        String imei = mTelephonyMgr.getDeviceId();
```

## Answers

### Answer by Anonymous User

TelephonyManager class can be used to get the IMEI number. It provides access to information about the telephony services on the device.

```
TelephonyManager mTelephonyMgr = (TelephonyManager)        getSystemService(Context.TELEPHONY_SERVICE);        String imei = mTelephonyMgr.getDeviceId();
```


---

Original Source: https://www.mindstick.com/interview/2580/write-code-snippet-to-retrieve-imei-number-of-android-phone

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
