Friday, April 6, 2012

SL4A Fast Track Android Software Development

SL4A gives us a rapid tool for developing software for Android. SL4A let us use our Android device as our development platform without using a PC. I have developed an application used for tracking our sales persons visit to our company customers. Stored information contains sales person's name, date, time, geo location, order amount and payment collection amount. Sales person will be asked his name on starting the application. Sales person will enter the store's name before entering the store. Sales person will enter the order amount and payment collection amount before leaving the store (outside the store for better GPS signal reception). All information is stored as csv files on \sdcard\dropsync folder. Using dropsync application the folder content is synchronized to a dropbox account space. The application itself consists of two tiers. First tier is the business logic tier developed using Python for Android + CherryPy library for providing web service on an Android device. Second tier is the user inteface tier using HTML + JavaScript + JQuery + form2js JQuery plugin for serializing HTML forms to JSON. The Python script visitlogws.py manages the HTML scripts to be displayed to user using droid.webViewShow method. Visitlogws.py also serves data to and from HTML scripts via JQuery's ajax call. I use form2js for shortening the JavaScript for reading and writing to an HTML form. All Python script, HTML scripts, CherryPy library and JavaScript libraries can be downloaded here. Extract the cherrypy.zip contents to \sdcard\sl4a\scripts folder and execute visitlogws.py. Create \sdcard\gps folder if it doesn't exist (on gingerbread this folder needs to be cleaned up often or it will eat up your free space). My recommended text editor for SL4A will be Jota. I hope my post will inspire you how to develop useful applications for personal or business use. Don't hesitate to drop comments for questions, corrections and suggestions. Thank you. ...Read more