Android Question sendsms does not sent sms

Status
Not open for further replies.

kalarius

Active Member
Licensed User
Longtime User
hi,
I have ver 8.50 for B4A
telephone xiaomi redmi note 5a android ver 7.2.1N2G47H

at the B4A configure paths
C:\android\platforms\android-28\android.jar for the jar and the
C:\Program Files (x86)\Java\jdk1.8.172\bin\javac.exe for the java

form manifest editor
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>

at the start activity I have the code
Sub Activity_Create(FirstTime As Boolean)

Per.CheckAndRequest(Per.PERMISSION_SEND_SMS)
Activity.Title="Send Sms from list"


*** and from the telephone setting from the menu permission I have check thet thet program has permision to SMS

when I run the program at the line
SendSMS.Send(myTelnum,myText)
it execute the line NO error message but it does not sent the sms.

I belive that it is something about the permisions but I do not know what.

any suggestions?

Kalarakis
Greece
 

kalarius

Active Member
Licensed User
Longtime User
this is my unfilter log

Logger connected to: Xiaomi Redmi Note 5A Prime
--------- beginning of main
TidaProvider()
java.lang.NoSuchMethodException: android.os.MessageQueue#enableMonitor()#bestmatch
at miui.util.ReflectionUtils.findMethodBestMatch(ReflectionUtils.java:338)
at miui.util.ReflectionUtils.findMethodBestMatch(ReflectionUtils.java:375)
at miui.util.ReflectionUtils.callMethod(ReflectionUtils.java:800)
at miui.util.ReflectionUtils.tryCallMethod(ReflectionUtils.java:818)
at android.os.BaseLooper.enableMonitor(BaseLooper.java:47)
at android.os.Looper.prepareMainLooper(Looper.java:112)
at android.app.ActivityThread.main(ActivityThread.java:6366)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
BoostFramework() : mPerf = com.qualcomm.qti.Performance@487931a
ClassLoader referenced unknown path: /data/app/com.smsfromlist2-2/lib/arm64
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
Starting remote logger. Port: 32257
current package=com.smsfromlist2, accessibility manager mIsFinalEnabled=false, mOptimizeEnabled=true, mIsUiAutomationEnabled=false, mIsInterestedPackage=false
QUALCOMM build : f47ef91, I09d312ff84
Build Date : 07/24/17
OpenGL ES Shader Compiler Version: XE031.09.00.04
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.5.5.R1.07.01.02.269.046
Remote Branch : NONE
Reconstruct Branch : NOTHING
Initialized EGL, version 1.4
Swap behavior 1
*** Debugger waiting for connection (0) ***
Show toast from OpPackageName:com.smsfromlist2, PackageName:com.smsfromlist2
*** Debugger waiting for connection (1) ***
After accept
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
BoostFramework() : mPerf = com.qualcomm.qti.Performance@5bb081b
BoostFramework() : mPerf = com.qualcomm.qti.Performance@cfcddb8
BoostFramework() : mPerf = com.qualcomm.qti.Performance@b780af7
BoostFramework() : mPerf = com.qualcomm.qti.Performance@77e1d64
Do partial code cache collection, code=30KB, data=28KB
After code cache collection, code=29KB, data=27KB
Increasing code cache capacity to 128KB
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
you are using which Android.jar (from which platforrm)?
Use Android.jar from Api 28
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
yes I have update all
at the samsung sIII neo it works
at xaiomi does not work

C:\android\platforms\android-28\android.jar
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
I try all these but nothing happen.
I have other 3 programs that can sent sms form my phone.
So I try to write the program form the begine as new one.
ok

that are the results
first it ask me it i permit to send sms >> ok
but when I press the button 1 to sent the sms NOTHING happend
so I add an new line at the start activite
and IT SENT THE SMS

see the code
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Per.CheckAndRequest(Per.PERMISSION_SEND_SMS)
    ' at XXXXXXXXXX id my phone number 
    mySms.Send("XXXXXXXXXX","test") ' THIS line send the test sms 
    Activity.Title="Send Sms from list"
    Activity.LoadLayout("View_1")
    myList.Initialize
    myStatus.Initialize("myStatus")
   
    Label2.Text="0" 'poses eggrafes exei
    Label4.Text="0"
    Label6.Text="0"


    Text1.Text="here is the text that I want to send" & CRLF & " kalarakis Michalis"
    Dim a As Int

    ' gia na balei ta dikaiomata sth karta
    If File.Exists(File.DirRootExternal ,"test.txt") =False Then a=a+1


    'mt.Initialize2(File.OpenInput(File.DirRootExternal  ,"pelaths.csv"),"ISO-8859-7")
    '    myList=mt.ReadList
   
    myList.Add ("Kalarakis;YYYYYYYYYYY")
    myList.Add("mhnas;XXXXXXXX") 
    myList.Add("rena;GGGGGGGGGG")
   
    Label2.Text=myList.Size
     
End Sub

 

Sub Button1_Click
    ' stelnv ta mhnhmata
    Dim Result As Int
    If Text1.Text.Trim="" Then
        Msgbox("No text message","insert text message;")
             
    Else
   
        Result=Msgbox2("Send sms?","Send sms sms","yes","No","",Null)
        If Result=DialogResponse.POSITIVE Then

            Dim myText  As String=Text1.Text:Dim AriumosThl As String
            Dim Nr As Int:Nr=0
            Dim Geniko As String:Dim Uesh As Int
            Dim Tr As Int
            For Tr=0 To 1' myList.Size-1  
                Geniko=myList.Get(Tr)
                Uesh=Geniko.IndexOf(";")+1
               
                AriumosThl=Geniko.substring(Uesh)
                 
                If AriumosThl.Trim<>"" Then
                   
                    mySms.Send(AriumosThl,myText) ' here is the problem
                    Log(AriumosThl)
                    Nr=Nr+1
                   
                End If
            Next
   
        End If
    End If
End Sub
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
HI
B4X:
If File.Exists(File.DirRootExternal ,"test.txt") =False Then a=a+1
Do you get permission for it?
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
NO problem for the read write to the card
If you read the code you will see that I do not use the card.
THE PROBLEM IS THAT IT CANNOT SEND THE SMS form the code inside the button1_click

the code at the activity_create works and sent the sms

*** if I include the file.exeist ......... in my code then it add the permission ****
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
HI
You must correctly get all the runtime privileges that your application requires. If you do not do this, the phone may block some functions that seem to have nothing in common.

P.S
Of course, only those that are marked as dangerous
 
Last edited:
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
Create a small test project with just one button, something obvious that should work. Set targetSdkVersion = "26" and get runtime permissions. Test if SMS sending works.
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
I solve the problem with the permission. From the telephone options I set permisions to the program for sms and files

but the problem still exist
i make a small code just at the activity_create
B4X:
Sub Activity_Create(FirstTime As Boolean)
    
   
    Activity.Title="Send Sms from list"
    Activity.LoadLayout("View_1")
  
 ' this line with greek character does not sent the sms   
' greek characters are "ISO-8859-7"

 mySms.Send("XXXXXXXXX","Μηχανη καταμετρησης κερματων 140ε +φπα καινουργια" & CRLF & " kalarakis Michalis ")
    
' this line with the english characters sent the message
    mySms.Send("XXXXXXXX","mhchanh katametrhshs kermatvn 140e +fpa kainoyrgia" & CRLF & " kalarakis Michalis  ")
  
end sub

any suggestion?
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
I set the permission form the option > permission >sms and same with the file.
it is the option from the telephone.
I do not have problem with permissions because this small code send sms
this line send the sms
mySms.Send("XXXXXXXX","mhchanh katametrhshs kermatvn 140e +fpa kainoyrgia" & CRLF & " kalarakis Michalis ")
the text is at english character set.

but i want to send sms with greek characters


the line with greek character does not sent the sms and NO errors
mySms.Send("XXXXXXXXX","Μηχανη καταμετρησης κερματων 140ε +φπα καινουργια" & CRLF & " kalarakis Michalis ")


the code is at #15 just these lines

I test the code at #15 and it works only with english characters.

**** (from the telephone aplication sms i can sent and receive sms with greek characters) ****
I have ver 8.50 for B4A android 28 and at the manager android 26
telephone xiaomi redmi note 5a android ver 7.2.1N2G47H
 
Upvote 0
Status
Not open for further replies.
Top