Page 1 of 1
QuickCalls app - SMS?
Posted: Sun Dec 11, 2011 1:53 am
by BarrySumpter
Hi all,
Not really back.
I'm taking the summer off to paint the house.
I've got a few minutes before we have to leave for the next Christmas gathering.
I thought I might see how much I've forgotten about LiveCode with a quick app.
My daughter Tatiana needs a lot of chauffeuring to and from gatherings.
Dropping off is easy.
But pickups are a bit volitile.
I don't go into the gatherings so as not to embarrass her or put pressure on her to leave.
When I get into the car I'll SMS her that I am on my way so she can start her good-byes.
When I'm a block or two away I'll SMS her that I'm here so she will come out straight away.
I'm hoping my QuickCalls app will help with these repettive, mundane, and distracting tasks.
There is a sample of how to fire a mobile phone call from the summer academy TickedOff project:
Code: Select all
on mouseUp
-- put field "number" into tNumber
put "xxxx xxx xxx" into tNumber
launch url "tel:" & tNumber
end mouseUp
This fires the phone dialing app with the Number already filled in and I just touch the "CALL" button - too easy.
I can't seem to find a way to fire the SMS app.
Anyone know how to sms from LiveCode for Android?
I'm thinking since it wasn't in the TickedOff sample that LiveCode can't do it.
Any positive constructive suggestions would be greatly appreciated.
Re: QuickCalls app - SMS?
Posted: Sun Dec 11, 2011 11:10 am
by bangkok
BarrySumpter wrote:
I can't seem to find a way to fire the SMS app.
Anyone know how to sms from LiveCode for Android?
Here is the way I used to send SMS from a LiveCode app :
-open an account with clickatell.com (reliable, cheap, but many other bulk SMS sending systems on the web)
-then in the LC app, just put :
Code: Select all
put "http://api.clickatell.com/http/sendmsg?user=XXXXXXXX&password=YYYYYYY&api_id=ZZZZZZZ&to=123456789&text=HELLO-WORLD" into toBeSent
put URL toBeSent into theResult
if theResult contains "ID" is false then
answer "Error. SMS not sent"
end if
I guess, it would work the same on a Android LC app.
Re: QuickCalls app - SMS?
Posted: Sun Dec 11, 2011 3:32 pm
by BarrySumpter
Can they beat .12c per sms in Aus?
Grrrr. Back to the agro of RR LC short comings.
It's not what I've forgotten what LC can do.
It's what I've forgotten what LC can't do.
Re: QuickCalls app - SMS?
Posted: Tue Dec 13, 2011 2:32 pm
by Bernard
Oh, ye of little faith
I've only ever done a couple of "hello world" type apps for Android (just to test the basic principles worked).
So, after seeing your disappointment with Livecode, I went to see how those programming Android in other ways were battling/solving this SMS problem. After you've shuddderd looking at the following code and frustrations, be glad you use Livecode:
http://stackoverflow.com/questions/1556 ... the-call-i
http://stackoverflow.com/questions/5390 ... in-android
http://stackoverflow.com/questions/4787 ... on-android
And then create your little SMS app as described above, and put this behind your buttons.
Code: Select all
put "your doting father is waiting for you" into tMsg
replace space with "%20" in tMsg
put "077177111666" into tRecipientNumber
put "sms:" & tRecipientNumber & "?body=" & tMsg into tURL
launch url tURL
Voila. It works on my Sony Ericcson Xperia. The SMS app comes up with "your doting father is waiting for you", ready to send to the designated number.
Who'd a thunk that Runrev would make our lives so easy? Your app should take no more than 3 mins to build & deploy.
The Livecode/android combination makes it so easy to play around with these things (I "test" directly on my USB-connected phone).
The clue is to look at how other developers are doing these things on Android in their language of choice. I didn't know that it would work in Livecode, but I guessed it just might, seeing what the URL schema for a SMS message should look like on Android.
Re: QuickCalls app - SMS?
Posted: Tue Dec 13, 2011 5:03 pm
by Dixie
Nice one Bernard...
You have delivered one of the best adverts for using LiveCode I've seen in a while...
be well
Dixie
Re: QuickCalls app - SMS?
Posted: Tue Dec 13, 2011 10:26 pm
by BarrySumpter
+1
LiveCode Resurrected!
On my HD2.
Fires off me sms client.
Which is farther than I was getting.
(I think. Too many Christmas parties since then.)
But packs everything together as the phone number.
With no 'body'
I'll see what trouble I can get into.
Thanks for the hint and the encouragement!
Re: QuickCalls app - SMS?
Posted: Wed Feb 15, 2012 12:59 am
by BarrySumpter
2 months later.
Could have sworn I posted my solution here.
But again may have been one of my drunken rampages to remove my content.
In protest for the lack of LiveCode for Android development.
Pretty much over it now.
Never got this to work on HD2 using LiveCode - tested on 4 of them.
Asked on either whirlPool or XDA and was told that Android itself was the prob.
Had to move to Basic4Android and sorted it out in about half an hour.
Just wish all the functionality in Basic4Android was available in LiveCode.
Just wish the dev interface in LiveCode was available in Basic4Android.
hmmm. Now there's an idea.
hth
Re: QuickCalls app - SMS?
Posted: Sat Mar 17, 2012 6:09 am
by BarrySumpter
Doh!
Is it too late to get this fix into 5.5?
Maybe its already fixed?
Nevermind.
Its working now on me hd2 using Dorimanix latest n greatest ROM
and LiveCode 4.6.4.
Maybe thats what either whirlPool or XDA meant.
That it is the VERSION of android that I was using.
Re: QuickCalls app - SMS?
Posted: Tue Feb 05, 2013 4:56 pm
by Mag
Bernard wrote:Code: Select all
put "your doting father is waiting for you" into tMsg
replace space with "%20" in tMsg
put "077177111666" into tRecipientNumber
put "sms:" & tRecipientNumber & "?body=" & tMsg into tURL
launch url tURL
Hi Bernard,
do you know if a code similar to this one, could work in iOS?
Re: QuickCalls app - SMS?
Posted: Tue Feb 05, 2013 8:53 pm
by Dixie
Mag...
This works...
Code: Select all
on mouseDown
if not mobileCanComposeTextMessage() then
/* iOS message will appear */
exit mouseDown
end if
put 0779XXXXXX into theNumber
put empty into theMessage
mobileComposeTextMessage theNumber , theMessage
if the result = "sent" then put "Your text message has been sent..." into theResponse
if the result = "failed" then put "The text message has not been sent..." into theResponse
if the result = "cancel" then put "You cancelled sending the text message" into theResponse
beep
answer theResponse with "OK"
end mouseDown
be well,
Dixie
Re: QuickCalls app - SMS?
Posted: Tue Feb 05, 2013 9:58 pm
by Mag
Thank you Dixie!
Re: QuickCalls app - SMS?
Posted: Sat Apr 13, 2013 10:00 am
by archer2009BUSknbj
Hi BarrySumpter
I love your App it's such a good example of creating something basic but something you'd actually end up using a lot.
Re: QuickCalls app - SMS?
Posted: Sun Apr 21, 2013 1:35 am
by archer2009BUSknbj
Dixie wrote:Mag...
This works...
Code: Select all
on mouseDown
if not mobileCanComposeTextMessage() then
/* iOS message will appear */
exit mouseDown
end if
put 0779XXXXXX into theNumber
put empty into theMessage
mobileComposeTextMessage theNumber , theMessage
if the result = "sent" then put "Your text message has been sent..." into theResponse
if the result = "failed" then put "The text message has not been sent..." into theResponse
if the result = "cancel" then put "You cancelled sending the text message" into theResponse
beep
answer theResponse with "OK"
end mouseDown
be well,
Dixie
I tried the code above plus a cut down version of it and every times the SMS part comes on screen, allows me to type out a Text message but when I press send it fails to send the SMS - the number is correct and when I send manually it works fine so my phone is OK
Any idea why I keep getting the message coming up "Message not sent" ? This is on Android 4.0.4
Re: QuickCalls app - SMS?
Posted: Sun Apr 21, 2013 10:18 am
by Dixie
archer...
I have just noticed that this is in the 'Android' forum..

I can only say that it certainly does work on an iphone... I don't have an android device on which I could test it.
Dixie
Re: QuickCalls app - SMS?
Posted: Wed Sep 11, 2013 12:00 pm
by samreenkhud
You must define a device for each cell phone number that you send/receive text messages to/from.