Android Question get phone imei?

Discussion in 'Android Questions' started by muhlis, Jan 2, 2014.

  1. muhlis

    muhlis Member Licensed User

    please help me?
    Code:
    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;
           
        }
     

    Attached Files:

    • help.png
      help.png
      File size:
      45.7 KB
      Views:
      197
  2. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Dim pid As PhoneId
    Log(pid.GetDeviceId)
     
    GvD, pjetson and Peter Simpson like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice