Blueprint for Mobile Clients
Table of Contents
We want a versatile client for Mobile devices to be able to talk to Sahana Eden servers which can be easily maintained and adapted to meet new requirements rather than the point solutions which have been developed to date which are unmaintained & not adaptable.
The ideal would be the ability to generate the code using the same core framework and data models. XForms are promising here, although our current XForm interface isn't complete (doesn't handle either Images or Locations) and can only handle data entry, not reporting.
Online
The simplest way to do this is to provide a layout for the web application suitable for smaller screens:
An initial protoype should be developed in static HTML/CSS which can then be ported to Eden.
- download a couple of pages' HTML & CSS & tweak the CSS until it is fully resizable.
Offline
Ideally, though, they should have local storage for use completely offline & then be able to sync back to the server using whatever connectivity becomes available:
- SMS
- compressed multi-part SMS to get maximal throughput
- BluePrint/Messaging
- forms should be updatable via SMS
- photos should stay offline until the phone has better connectivity, but then the photo needs to be used to update the same record
- GPRS/3G
- WiFi / Serval?http://www.servalproject.org/
- BlueTooth
- J2ME eedocs:
- tbc
- Python docs:
Using the open XForms standard means that we can support handsets using both Android & J2ME.
XForms editor:
- Written in Django, so should be easy to port to Sahana Eden:
- Written in GWT, so includable in Eden as a simple HTML page:
- PurcForms - can import the output from our controller, powerful but not for non-techies!
- OX-Designer - more basic, but pretty. No import yet. Built for OpenMRS (which uses ODK)
- Written in Ruby Rack, so harder to integrate as-is:
XForms can be submitted using SMS by including the encoding format within the XForm so that client & server agree on the encoding:
ODK Integration
- Be able to take a CSV export from ODK Aggregate & display this as a layer on the Sahana Map
- Import into a system which can support Dynamic Tables
- Like DC & gis_shapefile
- Identify the Lat/Lon fields & use these direct for mapping (treat these like gis_cache or gis_feature_query)
- Be able to select attributes for styling (initially via hand-crafted JSON, later via UI)
- Be able to display all attributes in Popup
- NB This could also be done by simply adding the layer as KML
- Import into a system which can support Dynamic Tables
- Be able to link to existing Sahana entities (Places, Facilities, People, etc)
- Build this support into Dynamic Tables
- De-duplicate on the import to create Foreign keys
- Write out XLSForm fragments with lookup lists (e.g. LocationSelector as obvious usecase)
- Be able to import directly into existing Sahana entities
- extend the XSLForm generator to create full forms with S3CSV-style column names/options
- Incident Reporting as obvious use-case
- Be able to do Reports on Dynamic Tables
- Requires being able to identify the field types (such as Dates)...which could be done by imoporting the XForm template or by smart analysis of the data
- Why? Stdised user interface behind a common login / roles / realm
- Be able to have ODK collect talk directly to Sahana
- Hard to support non-Sahana generated XForms, which would mean less valuable to users
- Means no manual interface to import data from ODK
Android
- DeveloperGuidelines/Mobile/Android
- UserGuidelines/Mobile - how to use ODK Collect with Sahana Eden
J2ME
Documentation on the current implementation is here: http://wiki.sahanafoundation.org/phase2/doku.php/dev:j2meclient
- This needs updating to the latest version of JavaRosa
JavaRosa is a fast-developing framework which uses XForms & J2MEPolish:
- http://code.javarosa.org
- OpenRosa - joint project between ODK & JavaRosa
This supports using Mesh4j to do synchronisation via SMS:
Multi-Platform Mobile App
- http://phonegap.com/ (Open Source)
- http://mobiledevices.about.com/od/mobileappbasics/tp/Top-5-Tools-Multi-Platform-Mobile-App-Development.htm
- http://www.appcelerator.com/
Alternatives
Another XForms/J2MEPolish client (Xfolite):
KUIX can be used to develop lightweight applications which work across may handhelds & forms can be customised easily via XML/CSS:
Old, un-maintained J2ME client for the PHP back-end, which just uses XML-RPC (=> requires Internet):
iPhone
Sahana Software Foundation have a developer license which can be used by anyone interested in developing this.
HTML 5
Responsive Web Design
Bootstrap (twitter.github.io/bootstrap) has been used to implement a responsive web design in the DRMP template: (https://github.com/flavour/eden/tree/master/modules/templates/DRMP). This could be extended to better support the default template by:
- Re-designing the following generic pages for mobile view:
- List / Table
- Search
- Reports
- Better supporting maps
- Reviewing & Testing for features which don't work on the responsive design
jQuery Mobile
This has a lot of industry backing for a truly cross-platform solution:
Sencha Touch
Cross-platform (Android/iPhone) HTML5 environment based on ExtJS
Mapping
OpenLayers now has touch support:
- http://m.openlayers.org
- http://www.slideshare.net/cedricmoullet/openlayers-mobile-code-sprint-2011
On our map, the Panning/Zooming works already, but Popups cannot be clicked yet.
We'd also like to move the LayerTree to a native-style widget.
ExtMap Touch:
Taking the Map offline:
- iPhone: http://www.offmaps.com
OpenStreetMap on Android:
Google Latitude would make an excellent Mobile Presence tool:
- http://googlemobile.blogspot.com/2011/02/check-in-with-google-latitude.html
- http://code.google.com/apis/latitude/v1/getting_started.html
Other projects
- Sahana Eden Mobile Framework
- FrontlineSMS
FrontlineForms is a proprietary add-on for FrontlineSMS allowing a mobile Java client to connect to FrontlineSMS and share data with it.
- Global Relief Technologies
- Ranked apps for iOS: http://ios-disasterapps.ideascale.com/
See Also: