using Sana Android client without a network connection

17 views
Skip to first unread message

Lakshman N

unread,
Dec 24, 2012, 3:36:12 AM12/24/12
to sana-de...@googlegroups.com
Hi - i am working on using Sana Android client in a situation where a network connection is not available or not affordable. I would ideally like to use the Sana Android client to collect the data using custom define procedures and have it written to in a SD card on the Android client. The Android client will then be physically connected to a PC  and the data that was collected transferred to the PC at the end of each day.

+ Any experience in the community in using the Android client as described above?
+ Any help with the code on where the Android client keeps the collected data would be appreciated.

regards
Lakshman

Eric Winkler

unread,
Dec 26, 2012, 6:30:48 AM12/26/12
to sana-de...@googlegroups.com
Basically, what I believe you would need to do is have the client exportt a portion of the SQLite database at the end of each day into a location on the external storage device on the device which was considered publicly accessible so that it could be read when the device was plugged in via a USB cable. Depending on the format you wanted,-i.e. directly as a SQLite db, converted to csv, JSON text, etc., you will need to do some processing which you can see some examples of in the MDSInterface class where the data is transformed into JSON text for POSTing. For SQLite export, you can essentially do a file copy of the database file listed in the ContentProviders and write to the location of our choice. One thing I would suggest would be to consider using a local wifi connection between the phone and PC if is available on the PC and just run a localized instance of the dispatch server on the PC. The dispatch server would be backed by a MySQL database on the PC and be more robust in terms of the options you would have available for later exporting. Hope that helps.
Best,
Eric
Sana Development

Lakshman N

unread,
Feb 1, 2013, 12:12:56 AM2/1/13
to sana-de...@googlegroups.com
Eric - thanks for your reply. I made a copy of the SQLite DB to begin with. I will try your suggesting of using the dispatch server once the required infrastructure is available. Thanks again for you prompt reply.

regards
Lakshman

Lakshman N

unread,
Feb 1, 2013, 2:36:04 AM2/1/13
to sana-de...@googlegroups.com
here is a link for making a copy of the DB, for those that are interested.
http://kpbird.blogspot.in/2011/09/android-copy-sqlite-database-from.html

regards
Lakshman
Reply all
Reply to author
Forward
0 new messages