pertican2010
pertican2010

Reputation: 11

Basic4Android Send SMS By Dual Sim Card

I Used B4A And Convert Java Code On This Topic Sending message automatically in Dual Sim To B4a Code But This Code Just Sending SMS On SimCard 1 And When Use Simcard 2 ID Still Sending By Simcard 1

Can AnyOne Know The Problem?

Regards


Sub Globals
     Private txtpm As EditText
     Private txtname As EditText
     Dim sim_card As SimCard
     Private Content_Resolver As ContentResolver
End Sub

Sub Activity_Create(FirstTime As Boolean)
       Activity.LoadLayout("send_sms_layout")
       sim_card.Initialize()
       StartService(modSMS)
End Sub

Sub Btn_Sim2_Click
    Dim msg As Map
    Dim Content_Values As ContentValues
    Dim Uri_ As Uri
    Try
        If sim_card.IsDualSIM = True Then 
            Content_Values.Initialize
            Dim sim_id1 As String
            Dim sim_id2 As String
            Dim r As Int
            sim_id1 = sim_card.GetSimSerialNumber1
            sim_id2 = sim_card.GetSimSerialNumber2
            Content_Values.PutString("value",sim_id2 )
            Uri_.Parse("content://settings/system")
        r = Content_Resolver.Update(Uri_,Content_Values,"name='sms_sim_setting'",Null)
    End If      
Catch
    ToastMessageShow(LastException,True)
End Try
Try 
msg.Initialize
msg.Put("message",txtpm.Text)
msg.Put("to",txtname.Text)
SendSMS(msg)    
Catch
    ToastMessageShow(LastException.Message,True)
End Try 
End Sub

Upvotes: 1

Views: 1578

Answers (0)

Related Questions