Table of Contents
J2ME client
J2ME client with multiple transport back end support (GPRS,SMS) supporting submission of form data for data collection on field.
Purpose
The J2ME client aims at enabling Sahana users to fill out the forms (missing persons reports etc) on their handheld/mobile phones and send the data via SMS/GPRS. Mobile phones are in widespread use in most parts of the world making this a quick and a cost efficient way of deploying data logging units in disaster prone areas. This serves the interest of emergency management community in enabling speedy data collection from field.
Current Status
- J2ME app prototype available.
ToDo
- Bundle more sample Forms
- Access GPS coordinates from either internal or BlueTooth GPS
- Sync via BlueTooth
- Compress the data
- Switch from XML to CSV
- BinaryXML for module/resource names? (This is compact however tightly couples client/server versions)
- Use gzip?
J2ME application user guide
Clock wise from the top: Form selection screen, Menu in form selection page, Settings page, Sample form view, Submission screen, Saved Forms.
Saved form screen details :
- A red entry next to the saved forms shows a submit failure due to incorrect data.
- A green entry shows successful submission.
- A brown entry shows that the message transmission was in progress but never completed.
- A white entry shows that the message was not submitted.
Demo applications
- Sample application suitable for most nokia mobiles can be found at Sahana-nokia.jar
- Sample application for a Generic mobile (Note: Saving settings does not work in the app) can be found here Sahana.jar
- For Android install Android runner, andme_signed.apk and then install Sahana.apk
- The data submitted via GPRS on the demo app can be seen at http://j2me.sahanapy.org/sahana/pr/person.
Note: The demo currently does not validate the submitted email addresses, enter a unique address during testing.
Note: The SMS submit currently tries to submit to +919198539599 - Please send an email to lifeeth[at]gmail[.]com for SMS testing.
J2ME application development guide
The J2ME app derives its code from JavaRosa ( http://code.javarosa.org/ ) the code and its derivatives are licensed under the Apache License, Version 2.0
Installing the Development Environment:
1. Install JDK.
2. Install Sun Java Wireless Toolkit for CLDC.
3. Install J2ME-Polish v2.0.4:
- Download J2ME-Polish from http://bitbucket.org/javarosa/javarosa-core/wiki/files/j2mepolish-2.0.4.jar
- Execute java -jar j2mepolish-2.0.4.jar
4. Create a work directory ( All commands below will be within the work directory):
- cd j2meapp/org.javarosa.sahana
- Set the polish.home,j2mewtk.home and wtk.home variables in build.properties to match your install locations.
- Test if the environment is properly setup by changing the device.identifier to Generic/DefaultColorPhone and executing “ant build” in the directory.
- For creating a jar for deployment execute → ant BuildRelease
5. Refer to Jar signing for details on signing the application for deployment.
Customizations:
1. Add the xforms to the resources directory
- A guide to create the xforms can be found at → http://code.javarosa.org/wiki/buildxforms
- In Sahana Eden a valid template for the xforms of module of choice can be obtained by going to
http://127.0.0.1:8000/eden/xforms/create/module_resource (replace 'module' & 'resource' as-appropriate)
2. Load the forms and the appropriate default configurations at the bottom of the file:
j2meapp/org.javarosa.sahana/src/org/javarosa/sahana/midlet/JavaRosaDemoMidlet.java
3. Select the phone model by changing the device.identifier in build.properties
- Valid devices can be found at : http://devices.j2mepolish.org/interactivedb/searchdevices.faces
- Generic device builds can be made : Generic Phone configuration list
4. Android packages:
- To create a package valid for android choose the following in build.properties
device.identifier=Generic/AnyPhone_240x320
- Build the corresponding jar file:
ant BuildRelease
- Install Android J2ME runner from http://www.netmite.com/android/
- Upload the jar and jad files created above to http://www.netmite.com/android/srv/1.6/getapk.php to obtain the apk for installation on android.