Sunday, May 27, 2012

Android App Inventor - More SMS Services

Since I wrote my last tutorial about using SMS services in AppInventor I have had a number of questions on the post which I thought I would expand on here.

I have added a some additional logic to the SMSTest application that will display the text message on the screen.



To achieve this I added a Label to the form called lblMessageReceived. When the phone receives a text message it will be displayed here.



I changed my IF blocks to a IFELSE block and included a block to set the lblMessageReceived.Text to the value of Message1.messageText if the messageText is NOT 'Status?'.


The image above shows the application running on emulator 5554 receiving a message from emulator 5556. You can see the label showing the contents of the text message.

This also shows the use of two running emulators to test communication application. The number in the title bar is the phone number of the emulator. This makes it very easy to test SMS applications.


I hope this tutorial has been helpful. Please feel free to comment if you need further information.

I have added a link to the source code here.

My other App Inventor tutorials:
App Inventor - Location Services
App Inventor - Lists
App Inventor - SMS Services
App Inventor - TinyWebDB Tutorial Source
App Inventor - TinyWebDB Part 2 - Web Service Source