Obtain Device ID - Android Hardware

Android examples for Hardware:Device ID

Description

Obtain Device ID

Demo Code


//package com.java2s;
import android.content.Context;

import android.telephony.TelephonyManager;

public class Main {
    public static String ObtainDeviceID(Context mContext) {
        TelephonyManager tm = (TelephonyManager) mContext
                .getSystemService(Context.TELEPHONY_SERVICE);
        return tm.getDeviceId();
    }/*from  w w w  . ja  v  a2  s .  c om*/
}

Related Tutorials