My next Android app is called “SMS Bot Widget” (the name “SMS Widget” was already taken). Like the Reader Widgets it is something that I myself wanted on my phone. I seem to keep sending the same SMS message to the same person a lot so I wanted a shortcut to send it for me with two taps. I found a widget in the Market for this but it force closed on me so I decided to create my own.
There’s actually two widgets: 1×1 and 2×1 depending on the size of the message needed (the text is cut off if it’s too long). Adding the widget launches the configuration screen which has one drop down box for name and another for number. Only contacts with phone numbers are displayed. There is a text box for entering the desired message up to 120 characters. Once the configuration is saved the widget displays the contact name at the top and the message underneath. Tapping on the widget launches the send message dialogue with OK and cancel buttons. It shows the full message and phone number so they can be checked before sending. Once the OK button is pressed, after a short delay, a text pop-up shows if the message was sent successfully. The message is also added to the sent messages in the SMS app so that there is a record of them.
Multiple widgets can be added and configured independently.
It took me longer than expected to develop this because of the differences between all the Android versions. More on this in another post.
SMS Bot Widget has been tested successfully on Android 1.5 (Hero), 1.6 (G1/Dream) and 2.1 (Nexus One).