title: Get UUID Android
body: <p>I have problem with UUID Android.This method get UUID Android and add permission Manifest  </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt;
  </code></pre>
  
  <p>this method this get UUID </p>
  
  <pre><code>   public String deviceUDID(Context ctx) {
          final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
  
          final String tmDevice, tmSerial, androidId;
          tmDevice = "" + tm.getDeviceId(); //line 82
          tmSerial = "" + tm.getSimSerialNumber();
          androidId = "" + android.provider.Settings.Secure.getString(ctx.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
  
          UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() &lt;&lt; 32) | tmSerial.hashCode());
          String deviceId = deviceUuid.toString();
          Log.d("Device Id", deviceId);
          return deviceId;
      }
  </code></pre>
  
  <p>when click in button with show on textView UUID, app stopped.</p>
  
  <p><strong>my error log</strong> </p>
  
  <pre><code>03-08 14:22:39.496 20825-20825/com.novum.smrtkarta E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.xxxx.smrtkarta, PID: 20825
  java.lang.SecurityException: getDeviceId: Neither user 10155 nor current process has android.permission.READ_PHONE_STATE.
  at android.os.Parcel.readException(Parcel.java:1620)
  at android.os.Parcel.readException(Parcel.java:1573)
  at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:4207)
  at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:706)
  at com.novum.smrtkarta.activity.GetNumberActivity.deviceUDID(GetNumberActivity.java:81)
  at com.novum.smrtkarta.activity.GetNumberActivity$1.onClick(GetNumberActivity.java:62)
  at android.view.View.performClick(View.java:5204)
  at android.view.View$PerformClick.run(View.java:21153)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>