I am using the X version 1.82. What is preventing the message from sending please?
Thank you.
CODE BELOW
//Called when application is started.
function OnStart()
{
//Create layout that fills the screen.
lay = app.CreateLayout( "Linear", "FillXY,VCenter" );
//Create text edit control for phone number.
txtNum = app.CreateTextEdit( "5550101", 0.8, -1 );
lay.AddChild( txtNum );
//Create text edit control for message.
txtMsg = app.CreateTextEdit( "Hello from Android!", 0.8, 0.3 );
lay.AddChild( txtMsg );
//Create 'Send' button.
btn = app.CreateButton( "Send", 0.4, 0.1 );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
//Add main layout to app.
app.AddLayout( lay );
//Create SMS object and set callbacks.
sms = app.CreateSMS();
sms.SetOnStatus( sms_OnStatus );
sms.SetOnMessage( sms_OnMessage );
}
//Handle 'Send' button.
function btn_OnTouch()
{
//Send the SMS message.
sms.Send( txtNum.GetText(), txtMsg.GetText() );
}
//Show SMS send status/progress.
function sms_OnStatus( status )
{
app.ShowPopup( status );
}
//Show in-comming SMS messages.
function sms_OnMessage( number, msg )
{
app.ShowPopup( number + ": " + msg );
}
Where did you get it from?
It was in response to a request for functions beyond what DS currently provides.
I made the request, so you made it clear that there is another version that provides what I need.
You also cautioned that apps made with the X version won't qualify for playstore publishing.
Remember?
As far as I know that is the latest X version available but you posted you were using 1.82
Is there any code that works or I am not doing something right?
The most important thing when SMS operations fail is to ensure that you are using an X version
I have a 1.82 beta version on my devices, so if there was a 1.82 X version, I could have easily installed it to test your code, so I spent time looking for it.
I can't immediately see a problem with your code and it is almost midnight here.
I stand by for solutions when you are ready.
Thank you.
My next challenge is that when messages came in the app though running was not able to detect the message.
How do I overcome this please?