Hi to everybody
Some years ago I wrote an app that sends and receives SMS. It was working, till 2022, sending and receiving SMS.. It is not a GooglePlay App, but just for my own use. I am using PhoneLibrary and PhoneSms object.
Now i need to work with it again, but the App crashes when I use the following code:
The error is:
java.lang.SecurityException: Sending SMS message: uid 10074 does not have android.permission.SEND_SMS.
The manifest is:
I don't have clear ideas on this topic, and where and if to add the permissions required. BTW, maybe on older devices it will work? As a matter of fact I got the error on a newer Phone, while the App worked on older Phones (and it could still run on these latter).
Thanks for ay hint.
Some years ago I wrote an app that sends and receives SMS. It was working, till 2022, sending and receiving SMS.. It is not a GooglePlay App, but just for my own use. I am using PhoneLibrary and PhoneSms object.
Now i need to work with it again, but the App crashes when I use the following code:
B4X:
dim RispSms as PhoneSms
RispSms.Send2(PairedPhone,Cosa,True,True)
java.lang.SecurityException: Sending SMS message: uid 10074 does not have android.permission.SEND_SMS.
The manifest is:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<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.RECEIVE_SMS)
AddReceiverText(SmsModule,
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>)
'End of default text.
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)
Thanks for ay hint.