SMS APP FAILS

42 views
Skip to first unread message

Nii Darku

unread,
Apr 23, 2020, 2:28:10 PM4/23/20
to DroidScript
Hi, I have tested the SMS code that code with DS but I get a message "Generic failure" when I tap the send button.

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 );
}

Steve Garman

unread,
Apr 23, 2020, 2:38:33 PM4/23/20
to DroidScript
I didn't know there was a 1.82 X version.

Where did you get it from?

Nii Darku

unread,
Apr 23, 2020, 6:10:09 PM4/23/20
to DroidScript
You provided the link to the x version on this platform some weeks ago.

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?

Steve Garman

unread,
Apr 23, 2020, 6:16:37 PM4/23/20
to DroidScript
Yes I remember that but the link I sent you was to DroidScript 1.80 X version

As far as I know that is the latest X version available but you posted you were using 1.82

Nii Darku

unread,
Apr 23, 2020, 6:21:46 PM4/23/20
to DroidScript
Yes Steve 1.80 you are right.
I meant that. So back to the SMS issue. Can we solve the generic failure problem?

Is there any code that works or I am not doing something right?

Steve Garman

unread,
Apr 23, 2020, 6:44:11 PM4/23/20
to DroidScript
It's not a question of "back to the SMS issue" as if I have been wasting Your time.

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.

Nii Darku

unread,
Apr 23, 2020, 6:49:40 PM4/23/20
to DroidScript
Thanks Steve for making things clear.

I stand by for solutions when you are ready.

Thank you.

Nii Darku

unread,
Apr 24, 2020, 4:52:05 PM4/24/20
to DroidScript
Hi guys I have overcome the SMS sending challenge.
It was caused by my NOT having credit on my phone.

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?

Reply all
Reply to author
Forward
0 new messages