Android Question get phone imei?

muhlis

Member
Licensed User
please help me?
B4X:
package muhlis.eli;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import android.content.Context;
import android.telephony.*;
import android.view.*;
@Version(1.0f)
@ShortName("Muhlis")
@Permissions(values={"android.permission.READ_PHONE_STATE"})


public class mu1 {
    public static String imei(){
        String n1="";
        String num;
        Context context = getWindow().getContext();
        TelephonyManager telephonemanage = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);             
          try        {   
      num=telephonemanage.getDeviceId();
      n1=num;
          }   
            catch(Exception e)        {   

              }
        return num;
       
    }
 

Attachments

Top