Error in targetSdkVersion 23+
java.lang.SecurityException: getDeviceId: Neither user 10223 nor current process has android.permission.READ_PHONE_STATE.
code :
Sub Process_Globals
.....
Dim id1 As String
Dim rp As RuntimePermissions
End Sub
Sub Activity_Create(FirstTime As Boolean)
...
rp.CheckAndRequest(rp.PERMISSION_READ_PHONE_STATE)
id1 = pid.GetDeviceId
AddManifestText(
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.READ_PHONE_STATE)
'End of default text.
java.lang.SecurityException: getDeviceId: Neither user 10223 nor current process has android.permission.READ_PHONE_STATE.
code :
Sub Process_Globals
.....
Dim id1 As String
Dim rp As RuntimePermissions
End Sub
Sub Activity_Create(FirstTime As Boolean)
...
rp.CheckAndRequest(rp.PERMISSION_READ_PHONE_STATE)
id1 = pid.GetDeviceId
AddManifestText(
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.READ_PHONE_STATE)
'End of default text.