Android Question Send sms with SIM card 1 or 2

morti08

Member
Hello, good time
Is there a way to send sms with SIM card 1 or 2 selectively? I searched almost everywhere, but unfortunately I didn't find anything for b4a

There is a Java code for this, but I don't know how to run it on b4a
Can someone help me

I will post the link to the Java code


Tanks



 

morti08

Member
Thank you for your answer... but it gives this error... I had already tested it... I also gave it access




Error occurred on line: 52 (Main)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
at b4a.example.KKK.main._activity_permissionresult(main.java:419)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.SecurityException: Sending SMS message: uid 10825 does not have android.permission.SEND_SMS.
at android.os.Parcel.createExceptionOrNull(Parcel.java:2437)
at android.os.Parcel.createException(Parcel.java:2421)
at android.os.Parcel.readException(Parcel.java:2404)
at android.os.Parcel.readException(Parcel.java:2346)
at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:2076)
at android.telephony.SmsManager$1.onSuccess(SmsManager.java:657)
at android.telephony.SmsManager.sendResolverResult(SmsManager.java:1707)
at android.telephony.SmsManager.resolveSubscriptionForOperation(SmsManager.java:1668)
at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:652)
at android.telephony.SmsManager.sendTextMessage(SmsManager.java:489)
at b4a.example.KKK.main.SendSMS(main.java:446)
... 18 more
 
Upvote 0

svanneste

Member
Licensed User
Upvote 0

agraham

Expert
Licensed User
Longtime User
In later versions of Android you can no longer directly send SMS texts unless you are the default SMS app
 
Upvote 0
Top