In this post i describe a simple application that repeat an sms when device receive a message; i'll also describe all androidScript features used.

AndroidScript is based on a global object named app that basically is an API that provided interfaces to device features: it allows to instanziate all kind of object used in an application.

The main one is Layout: you can think of this as a container for your app where all elements are appended as children.

The basic structure of an app is: 

   1: function OnStart()
   2: {
   3: lay = app.CreateLayout( "linear", "VCenter,FillXY" );
   4: app.AddLayout( lay );
   5: }
Show/Hide Line Numbers . Full Screen . Plain

First, all is grouped in a function OnStart(): this is about equivalent to OnDeviceReady() of other libraries/frameworks and runs the app when devide is ready.

Layout is instanziated with 2 arguments:

  1.  linear: this stands for a linear disposition of all controls created in it
  2. VCenter dispose the layout content vertically centered, and FillXY arrange the layout to adact to the device scree.

App and Layout objects have many other argument option, also many methods that to control background color, color, position you can find in docs section of androidScript: i'll describe the ones used in this app.

Let's complete our app adding an image and a button: when clicking on it the sms will be repeated. 

   1: function OnStart()
   2: {
   3:  messaggio = "";
   4:  //Create a layout with objects vertically centered.
   5:  lay = app.CreateLayout( "linear", "VCenter,FillXY" );
   6: img = app.CreateImage( "Img/sms.gif", 0.6, -1 );
   7:  lay.AddChild( img );
   8:  btn = app.CreateButton( "Repeat", 0.3, 0.1 );
   9:  btn.SetMargins( 0, 0.05, 0, 0 );
  10:  lay.AddChild( btn );
  11:  //Set function to call when button pressed.
  12:  btn.SetOnTouch( btn_OnTouch );
  13:  //Add layout to app.
  14:  app.AddLayout( lay );
  15:  //Create SMS object and set callbacks.
  16:  sms = app.CreateSMS();
  17:  sms.SetOnMessage( sms_OnMessage );
  18: }
  19: //speech in-coming SMS messages.
  20: function sms_OnMessage( number, msg )
  21: {
  22:  messaggio = msg;
  23:  //var pitch = 1.0, speed = 1.0;
  24:  //app.TextToSpeech( msg, pitch, speed );
  25:  btn_OnTouch();
  26: }
  27: function btn_OnTouch()
  28: {
  29:  if(messaggio != ""){
  30:  var pitch = 1.0, speed = 1.0;
  31:  app.TextToSpeech( messaggio, pitch, speed );
  32:  }
  33: }
Show/Hide Line Numbers . Full Screen . Plain


   1: img = app.CreateImage( "Img/sms.gif", 0.6, -1 )

this is the app method to create an image: it requires 3 args: 

  1. Img/sms.gif is the image sms.gif loaded from the Img folder: yoy can upload images for your app clicking on Assets link in the top bar od the development area of androidScript
  2. the second argument is the H image dimension  in percentage of the layout: 0.6 stands for 60% 
  3. the third argument is the V image dimension  in percentage of the layout:-1 stands for original V dimension of the image but we can define this as a percentage of the layout 

   1: lay.AddChild( img );

now we append the image create as a child of layout. 

   1: btn = app.CreateButton( "Repeat", 0.3, 0.1 );
   2: btn.SetMargins( 0, 0.05, 0, 0 );
   3: lay.AddChild( btn );
   4: btn.SetOnTouch( btn_OnTouch );
   5: //Add layout to app.
   6: app.AddLayout( lay );
Show/Hide Line Numbers . Full Screen . Plain

 the app.createButton(..) method creates a button: this method is invoked with 3 arguments:

  1. "Repeat": is the text appearing on the button
  2. is the H dimension of the button: 0.3 stands for 30% of the layout;
  3. is the V dimension of the button: 0.1 stands for 10% of the layout

the btn.setMargin(...) set the margin of the button : in order are top, right, bottom, left

Finally we append the button to our layout having the grafical aspect completed, so we start with the logic. 

   1: //Set function to call when button pressed.
   2: btn.SetOnTouch( btn_OnTouch );
   3: //Add layout to app.
   4: app.AddLayout( lay );
Show/Hide Line Numbers . Full Screen . Plain

Here we first define an event listener, the function Btn_onTouch() to the button, and append all object to our layout.

   1: sms = app.CreateSMS();
   2: sms.SetOnMessage( sms_OnMessage ); E
Show/Hide Line Numbers . Full Screen . Plain

We first create an sms object with the method app.CreateSMS(), and then assign a function, sms_OnMessage(), as event listener of the sms incoming event.

   1: function sms_OnMessage( number, msg )
   2: {
   3:  messaggio = msg;
   4: btn_OnTouch();
   5: }
Show/Hide Line Numbers . Full Screen . Plain

This function only copy the text of the sms to the global variable message : in this way it is not lost and can be repeate clicking on the button btn. 

   1: function btn_OnTouch()
   2: {
   3:  if(messaggio != ""){
   4:  var pitch = 1.0, speed = 1.0;
   5:  app.TextToSpeech( messaggio, pitch, speed );
   6:  }
Show/Hide Line Numbers . Full Screen . Plain

This function speechs the sms content, by the use od the app.TextToSpeech() method, with 3 args:

  1. messaggio: the variable containg sms content
  2. pitch: quality of sinthetized voice
  3. speed: speed of sinthetized voice

I suggest to try more values for pitch and speed to adapt the response to your locale.

Even if this app already has a pratical usefullness, when androidScript will permit to read device contacts, a usefull upgrade will be to set a list of contact wfrom which repeat sms, but this is another story.

For now, that's all folks.

Steve Garman
on Saturday 06 September 2014 07:47 AM
Thanks for that Salvatore. It works really well.
Salvatore Fusto
on Monday 08 September 2014 01:07 AM
Happy this is usefull.
essay center writing service
on Thursday 10 December 2015 05:34 AM
Education has many faces which are running in our society. If the student who wants to become a doctor. So the student has to study the natural sciences subject like biology like it, these are also the branches of the educational setup.
celine outlet
on Monday 09 May 2016 02:44 AM
We first create an sms object with the method app.CreateSMS(), and then assign a function, sms_OnMessage(), as event listener of the sms incoming event.
hermes outlet
on Monday 09 May 2016 02:44 AM
you can think of this as a container for your app where all elements are appended as children.
chanel replica
on Thursday 02 June 2016 02:53 AM
Lift Lafayette Karl Lagerfeld, the apperception will be his sunglasses white hair braids Cock absurd day Lengkudaodi image, but in actuality he is abound old elf.
research paper services
on Saturday 25 June 2016 07:45 AM
Your app is very useful and there is a lot of to learn out of your blog. Continue developing your project.
on Tuesday 28 June 2016 07:53 AM
or your app where all elements are appended as children.
show box app
on Friday 29 July 2016 07:10 AM
ShowBox app is used to stream videos, films, TV Shows and serials with free of cost, and it allows you to download all types of watching latest Showbox movies ..
spicy beef jerky for sale
on Monday 03 October 2016 04:21 AM
It is perfect time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it
view homes for sale
on Monday 03 October 2016 08:16 PM
You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.
car cover
on Saturday 08 October 2016 04:50 AM
This type of message always inspiring and I prefer to read quality content. so happy to find good place to many here in the post. the writing is just great. thanks for the post.
car cover
on Saturday 08 October 2016 04:54 AM
There is obviously a lot to know about this. I think you made some good points in Features also. ! Keep working, great job!
gift baskets for men
on Sunday 09 October 2016 12:10 AM
I am overwhelmed by your post with such a nice topic. Usually I visit your blogs and get updated through the information you include but today’s blog would be the most appreciable
thank you gift baskets
on Sunday 09 October 2016 02:03 AM
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging..
tact advisory
on Tuesday 11 October 2016 06:42 AM
Thank you for some other informative website. The place else may just I get that kind of information written in such a perfect method? I have a venture that I am simply now running on, and I’ve been at the glance out for such info
epos system
on Tuesday 11 October 2016 10:22 PM
Connect Multichannel EPoS helps you manage all your stock from one place using simple 'drag and drop', making it easier
Novelty Ties
on Thursday 13 October 2016 01:53 AM
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information
womens wallets
on Friday 14 October 2016 10:38 PM
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
Dieser Spiegelreflexkamera Te
on Monday 17 October 2016 04:21 AM
Very interesting blog. A lot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definitely interested in this one
Carpet Cleaner Mattoon IL
on Monday 17 October 2016 10:14 AM
When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.
natural gastric ball
on Thursday 20 October 2016 05:01 AM
I must say, I thought this was a pretty interesting read when it comes to this topic. Liked the material. . . . .
on Thursday 20 October 2016 10:40 AM
Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here.
best electric razor for men
on Friday 21 October 2016 07:38 AM
ave got complete sense without confusing the readers.paralegal services
xtc kopen
on Saturday 22 October 2016 07:35 AM
I am a new user of this site so here i saw multiple articles and posts posted by this site,I curious more interest in some of them hope you will give more information on this topics in your next articles
gsniper review
on Monday 24 October 2016 04:53 AM
Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.
buy dissertation online
on Tuesday 25 October 2016 03:16 AM
Android scripts is a well-known apparatus to the application engineers who are energetic to create various sorts of android applications. With the assistance of this instrument, numerous application engineers discovered some compelling approaches to growing amazing applications for different purposes.
on Tuesday 25 October 2016 04:38 AM
I hope this information will be great for the readers. Accessing such a post is little difficult for us. Here you are shared all the important points very effectively.
cabling staffing
on Tuesday 25 October 2016 04:50 AM
Thanks for it, i have been seeking for information regarding this material for ages and yours is that the best I even have discovered up to now
family portrait Hong Kong
on Wednesday 26 October 2016 05:32 AM
Superb blog post. Any place strikes numerous pressing obstacles of your modern culture. People can not be uninvolved that will those obstacles.
Best lasagna in Toronto
on Wednesday 26 October 2016 10:08 AM
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
stylus pen
on Thursday 27 October 2016 10:16 AM
Great blog. Lets stay connected. You can visit my online gift idea store
window and door installer jobs
on Saturday 29 October 2016 10:18 PM
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
travel course
on Sunday 30 October 2016 12:20 AM
You have talked about an important topic in this article. I think today most of the people are not giving much importance or trust in relationships. I am so glad to read this topic on this blog. Thank you!
on Thursday 01 December 2016 12:50 AM
Android scripts are famous tools to the application engineers who are active to make various sorts of android applications. With the help of this tool, numerous application engineers exposed some forceful approaches to rising astonishing applications for various purposes.
essay writing service
on Tuesday 07 February 2017 12:56 AM
Amazing post. I am so impressed. Could never think of such a thing is possible with it...I think you have a great knowledge especially while dealings with such subjects...
assignment help UK
on Monday 27 February 2017 08:53 AM
I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!!!!
on Sunday 05 March 2017 05:17 AM
This post is really magnificent. I really like this post. It is one of the best posts that I ve read in a long time. Thanks a lot for this really good post. I really appreciate it!Passport Seva
usps tracking
on Saturday 18 March 2017 02:21 PM
this is not
Love Commands
on Monday 20 March 2017 12:56 PM
Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
essayace review
on Tuesday 09 May 2017 04:39 AM
A complete procedure of sms 2 speech you like to shared in this article. It's not lengthy procedue but yes little bit tough to understand it. Here you fully try to make it easy for everyone who interested to learn about it.
Lakeway Home Builders
on Wednesday 31 May 2017 08:44 AM
Should there be another persuasive post you can share next time, I’ll be surely waiting for it.
Austin Texas Houses
on Wednesday 07 June 2017 11:13 AM
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work.
Masters Dissertation Writing
on Saturday 22 July 2017 10:24 AM
Regardless of the possibility that this application as of now has a pratical usefullness, when androidScript will allow to peruse gadget contacts, a usefull overhaul will be to set a rundown of contact wfrom which rehash sms, yet this is another story
Coursework Help
on Saturday 22 July 2017 10:26 AM
Training has many confronts which are running in our general public. In the event that the understudy who needs to end up noticeably a specialist. So the understudy needs to examine the common sciences subject like science like it, these are additionally the branches of the instructive setup
on Sunday 10 December 2017 08:07 PM
Great artcile, yet it would be better if in future you can share more about this subject. Continue posting.
EDD phone number live person
on Wednesday 13 December 2017 01:57 AM
This is truly a decent and instructive, containing all data furthermore greatly affects the new innovation.
on Thursday 17 May 2018 06:27 AM
We know how to backup WordPress websites or any type of online website for you and the bot does simple website restores for you too. websitebackupbot
on Thursday 02 August 2018 10:03 AM
Angry Birds is one of the most popular games. Angry Birds is physics based puzzle game with beautiful graphics. In this game you have to eliminate the evil pigs by slingshots using the birds and retrieve their eggs. You have different types of birds with different abilities to kill the pigs. This is a highly interesting game.
Health And Exercise Tips
on Monday 10 September 2018 05:16 AM
Your job ends with writing and submitting the articles.
on Wednesday 12 September 2018 03:04 AM
This is the proper weblog for anyone who wishes to be familiar with this topic. You know a whole lot its practically challenging to argue on hand (not that When i would want…HaHa). You definitely put a brand new spin on the topic thats been discussing for several years. Great stuff, just wonderful! Thanksgiving Day Status
on Friday 14 September 2018 09:55 AM
Amazing site, Distinguished criticism that I can handle. Im pushing ahead and may apply to my present place of employment as a pet sitter, which is exceptionally charming, however I have to extra extend. Respects. Adhum Carter
on Tuesday 25 September 2018 06:12 AM
So lucky to find this website. Thank you so much! Hope to hear more updates on the instagram technology information. Thanks!
Kratom samples pack
on Saturday 27 October 2018 03:13 AM
Incredible Article it its truly instructive and inventive update us as often as possible with new upgrades. its was truly important. much obliged.
on Wednesday 19 December 2018 03:31 AM
Determine the inclusions in your travel packages. The best deal travel packages are those that offer more than just an accommodation and an air fare
Kumar sagakara
on Thursday 03 January 2019 03:52 PM
<a"> Find Out Bihar 10th Admit Card 2019 NEWS Here </a>
duo for pc
on Tuesday 02 April 2019 04:08 AM
Streaming TV
on Monday 03 June 2019 06:35 AM
Find legitimate ways to watch streaming TV live online or learn more about streaming services and devices. Our YouTube channel helps people get a clearer view in the world of streaming media.
Benefits of Dragon Fruit
on Saturday 24 August 2019 04:44 PM
You are doing a good deal. Your article demonstrates your hard work and experience you have got in this field. Thank you for it.
tutu app
on Tuesday 05 November 2019 01:29 AM
Very interesting information, I really like it because it can add insight for me more broadly, thank you very much for this extraordinary information

tutuapp download
on Wednesday 06 November 2019 09:41 AM
Your page looks wonderful, it's great and full of infos. Keep it up!
on Wednesday 13 November 2019 10:15 AM
Say thanks a lot for your energy to have had these things together on this web site. Mary and that i very much appreciated your knowledge through your articles in certain things. I am aware that you have many demands on your own program so the fact that you took as much time like you did to steer people like us by means of this article is actually highly valued. Risker på Better Globe
on Wednesday 13 November 2019 10:21 AM
This design is incredible! You obviously know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almostHaHa!) Great job. I really loved what you had to say, and more than that, how you presented it. Too cool! sailing charters bvi
Hamilton ON
on Wednesday 13 November 2019 10:35 AM
Your site is exactly what I have looking for!
Thanks for keeping people up on what's happening.

Hamilton ON
on Wednesday 01 January 2020 09:04 AM
Excellent! Your post has a ton comment posts. How did you get all of these bloggers to see your post I’m very jealous! I’m still getting to know all about posting information on the net. I’m going to look around on your website to get a better idea how to achieve success. Thank you! modern cement tile
on Sunday 05 January 2020 08:53 AM
Sometimes, blogging is a bit tiresome specially if you need to update more topics. Gentleman barbers Birmingham


Youre so cool! I dont suppose Ive read anything like that just before. So nice to uncover somebody with some original thoughts on this subject. realy appreciate starting this up. this excellent website is a thing that is needed on-line, somebody with a bit of originality. valuable job for bringing new stuff to the net! ????
on Wednesday 05 February 2020 06:03 AM
I discovered your blog site on the search engines and check several of your early posts. Preserve within the really good operate. I recently extra your Feed to my MSN News Reader. Looking for toward reading much more of your stuff at a later time!… 389poker
on Tuesday 11 February 2020 06:27 AM
I believe one of your commercials caused my web browser to resize, you may well want to put that on your blacklist.

I’m not sure exactly why but this weblog is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later and see if the problem still exists. CBD gummies
fyve derbyshire floorplan
on Tuesday 11 February 2020 06:36 AM
Wow, wonderful blog layout! How lengthy have you ever been running a blog for? you make running a blog glance easy. The total look of your web site is magnificent, well the content material!
on Saturday 15 February 2020 03:32 PM
Whats up, I’ve been havin a tough time attempting to rank high for the term “victorias secret coupon codes”… PLEASE approve my comment!! CBD store


Yes, really. I join told all above. We can communicate on this theme. Here or in PM. cabinet dentar ieftin in uk
CBD pills
on Monday 17 February 2020 04:45 AM
I like the efforts you have put in this, regards for all the great articles . CBD pills
on Tuesday 18 February 2020 11:32 AM
Cool share about olive skin it is really. Friend on mine has been waiting for this info CBD gummies


Surprisingly! It truly is as if you study my thoughts! A person seem to understand so a lot relating to this, exactly like you authored the book in it or even something. I feel which you can perform with some images they are driving the message property a bit, besides that, this really is good weblog. The outstanding study. I’ll undoubtedly review again. sbowin
on Sunday 23 February 2020 05:07 AM
This is actually a good impacting view on this specific idea. And I’d like you to know that I’m really pleased you shared your feelings and information and I discovered that i believe I agree. I genuinely admire your very clear writing additionally , the work may possibly have invested writing this article. A great many thanks yous for this sound work additionally very good luck with the website, I will be looking forward to new subjects within the future. ????


you have a great blog here! would you like to make some invite posts on my weblog? ????? ??
amna seo
on Wednesday 26 February 2020 12:34 AM
This is what commonly happens to the newbies in the business industry who do not know how to effectively market their product or service or
on Thursday 12 March 2020 03:23 AM
i do admire psychics for their ability to sense some weird stuffs like predict the future or something` best CBD oil

Thanks , I’ve recently been looking for information about this topic for ages and yours is the best I have discovered till now. But, what about the conclusion? Are you sure about the source? massage gun
on Thursday 12 March 2020 05:49 AM
hey good site i will definaely come back and see again. <a href=''></a>


To be sure with all your thoughts here and I love your blog! I’ve bookmarked it to ensure that I am able to come back & read more in the future. <a href=''>silk pillowcase</a>
on Monday 16 March 2020 01:59 AM
The next time I learn a weblog, I hope that it doesnt disappoint me as much as this one. I mean, I do know it was my choice to read, however I actually thought youd have something attention-grabbing to say. All I hear is a bunch of whining about something that you could fix for those who werent too busy in search of attention.
on Tuesday 17 March 2020 03:38 AM
I think this web site has very superb composed subject material articles .
amna seo
on Wednesday 18 March 2020 11:57 AM
There are plenty of service apartments out there, and here are some reasons why they are great alternatives to hotels.alternatives of FirstRowSports
watch free movies
on Friday 20 March 2020 11:59 AM
Interestingly you write, I will address you'll find exciting and interesting things on similar topics.
on Monday 23 March 2020 06:13 AM
Hello! I just want to supply a massive thumbs up to the wonderful information you’ve here for this post. I’ll be returning to your blog post for additional soon. ??
on Monday 23 March 2020 06:35 AM
You should mainly superior together with well-performing material, which means that see it:
on Wednesday 25 March 2020 01:34 PM
This content is simply exciting and creative. I have been deciding on a institutional move and this has helped me with one aspect.
on Thursday 26 March 2020 01:39 PM
It is especially decent, though look into the tips during this home address.
on Friday 27 March 2020 04:54 AM
The most interesting text on this interesting topic that can be found on the net ...
on Saturday 28 March 2020 03:53 AM
Oh my goodness! an amazing article dude. Many thanks Nonetheless I’m experiencing trouble with ur rss . Don’t know why Can not sign up for it. Is there anybody finding identical rss problem? Anyone who knows kindly respond. Thnkx 389poker
(required - never shown publicly)
Web Site  
Notify me of new comments via email.
Notify me of replies via email.