Simple sms send

Fox

Active Member
Licensed User
Longtime User
Why this code not work?

Dim Sms As PhoneSms
Dim number As PhoneId

Sms.Send(0123456, "The Phone with the number" & number.GetLine1Number & "Send you an mail the phone is on:" & ResLocation.Latitude & " - " & ResLocation.Longitude)

get me follow error:

Sms.Send(0123344523, \
javac 1.6.0_25
src\main.java:509: integer number too large: 0123344523
mostCurrent._sms.Send(BA.NumberToString(015772397223L),"The Phone with the number"+mostCurrent._nummer.GetLine1Number()+"Send you an mail the phone is on:"+BA.NumberToString(_reslocation.Latitude)+" - "+BA.NumberToString(_reslocation.Longitude));
^

why this not work?

I just change the phonenumber ;)

ok i solved it i just use for all some variables.
 
Last edited:

XverhelstX

Well-Known Member
Licensed User
Longtime User
Try the following:

B4X:
Dim Sms As PhoneSms
Dim number As PhoneId

Sms.Send("0123456", "The Phone with the number" & number.GetLine1Number & "Send you an mail the phone is on:" & ResLocation.Latitude & " - " & ResLocation.Longitude)

In the documents it says:
Send (PhoneNumber As String, Text As String)
so your phonenumber must be a string. I'm not sure if it converts the int to a string though.

XverhelstX
 
Upvote 0

Fox

Active Member
Licensed User
Longtime User
Try the following:

B4X:
Dim Sms As PhoneSms
Dim number As PhoneId

Sms.Send("0123456", "The Phone with the number" & number.GetLine1Number & "Send you an mail the phone is on:" & ResLocation.Latitude & " - " & ResLocation.Longitude)

In the documents it says:
Send (PhoneNumber As String, Text As String)
so your phonenumber must be a string. I'm not sure if it converts the int to a string though.

XverhelstX

thanks :) i will try this :)
 
Upvote 0

rbsoft

Active Member
Licensed User
Longtime User
Even if it converts the int to a string it would not be correct because of the leading "0" in the phone number.
 
Upvote 0
Top