QuickCalls app - SMS?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

QuickCalls app - SMS?

Post by BarrySumpter » Sun Dec 11, 2011 1:53 am

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.
QuickCalls.gif
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.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: QuickCalls app - SMS?

Post by bangkok » Sun Dec 11, 2011 11:10 am

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.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: QuickCalls app - SMS?

Post by BarrySumpter » Sun Dec 11, 2011 3:32 pm

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.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm

Re: QuickCalls app - SMS?

Post by Bernard » Tue Dec 13, 2011 2:32 pm

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.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: QuickCalls app - SMS?

Post by Dixie » Tue Dec 13, 2011 5:03 pm

Nice one Bernard...

You have delivered one of the best adverts for using LiveCode I've seen in a while...

be well

Dixie

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: QuickCalls app - SMS?

Post by BarrySumpter » Tue Dec 13, 2011 10:26 pm

+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!
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: QuickCalls app - SMS?

Post by BarrySumpter » Wed Feb 15, 2012 12:59 am

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
Last edited by BarrySumpter on Sat Mar 17, 2012 6:52 am, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: QuickCalls app - SMS?

Post by BarrySumpter » Sat Mar 17, 2012 6:09 am

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.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: QuickCalls app - SMS?

Post by Mag » Tue Feb 05, 2013 4:56 pm

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?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: QuickCalls app - SMS?

Post by Dixie » Tue Feb 05, 2013 8:53 pm

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

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: QuickCalls app - SMS?

Post by Mag » Tue Feb 05, 2013 9:58 pm

Thank you Dixie!

archer2009BUSknbj
Posts: 72
Joined: Sat Apr 06, 2013 8:09 am

Re: QuickCalls app - SMS?

Post by archer2009BUSknbj » Sat Apr 13, 2013 10:00 am

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.

archer2009BUSknbj
Posts: 72
Joined: Sat Apr 06, 2013 8:09 am

Re: QuickCalls app - SMS?

Post by archer2009BUSknbj » Sun Apr 21, 2013 1:35 am

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: QuickCalls app - SMS?

Post by Dixie » Sun Apr 21, 2013 10:18 am

archer...

I have just noticed that this is in the 'Android' forum.. :oops: 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

samreenkhud
Posts: 2
Joined: Wed Sep 11, 2013 11:49 am

Re: QuickCalls app - SMS?

Post by samreenkhud » Wed Sep 11, 2013 12:00 pm

You must define a device for each cell phone number that you send/receive text messages to/from.

Post Reply

Return to “Android Deployment”