Android Question SMS from tablet to phone doesn't work

Gerrard

Member
Licensed User
I have a Samsung tablet model P1000 running android 2.3.3, and a Samsung phone running android 4.1.2. I am able to send an SMS manually from the tablet to the phone and it works. However, using the app below on the tablet nothing happens and the SMS does not come to the phone.
B4X:
#Region  Project Attributes
   #ApplicationLabel: TrialSMS
   #VersionCode: 1
   #VersionName:
   'SupportedOrientations possible values: unspecified, landscape or portrait.
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
   #FullScreen: False
   #IncludeTitle: True
#End Region

Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim lblMobileNo As Label
   Dim lblMessage As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("main")
   Dim Sms As PhoneSms
   Dim MobileNo As String
   MobileNo = "+27613798660"
   lblMobileNo.Text = MobileNo
   Dim messagetext As String
   messagetext = "hello there"
   lblMessage.Text = messagetext
   Log("msg=" & messagetext)
   Log("MobileNo=" & MobileNo)
   Sms.Send(MobileNo, messagetext)
   ToastMessageShow("sms " & messagetext & " to " & MobileNo, True)
   Log("sms " & messagetext & " to " & MobileNo)
End Sub
If I use the same app on the phone to send an SMS to the tablet it works.
What can I do?
 

Gerrard

Member
Licensed User
Your code looks correct. Does this tablet have a phone number?
Yes it does, and the app works on the phone and sends the sms okay to the tablet. And I can send an sms manually from the tablet to the phone.
But the app doesn't work on the tablet and there is no error message! The sms never gets to the phone.
 

Gerrard

Member
Licensed User
Hi Erel, i am pleased to let you know that I solved the problem. On the tablet, in Account and sync settings , then in General sync settings, I had to tick Background data ON. The sms from the tablet to the phone works perfectly.
I got the clue by looking at my phone logs and there was no record in the logs of the sms sent from the phone to the tablet.
Cheers
Gerrard
 
Top