0

I am unable to figure out what is the best way to achieve a scenario like this:

Working on a project that would have android application as client.

  1. User will take their device with the android application installed to field/visit and capture/punch/key data through out the day. This data would be stored locally on the device in SQLite database.
  2. The data captured in SQLite needs to be exported out and imported into the desktop app (it could be java or .net based) for further processing.

Other points: A. User could connect the phone via usb to desktop. B. data flow would always be in one direction (i.e. Phone to Desktop). C. No internet connection on the phone

My dilemma is how to access the sqllite database programmatically in desktop application? Are there any JDBC drivers that could read data from the sqlite database from a device connected via USB to the computer?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3156301
  • 45
  • 1
  • 9
  • 1
    you simply cannot access database using USB or any other application as it is protected, you need to have root permission in order to access your `data` folder on your phone. The best way will be using JSON. – Atif Farrukh Jul 04 '14 at 11:48
  • possible duplicate http://stackoverflow.com/questions/4905579/read-sqlite-db-file-using-java – Rajesh N Apr 27 '17 at 09:44

1 Answers1

0

This is just a way to do what you want, there are more ways to do it but from my point of view is the most accurate and scalable.

You would have to make a webservices server on Java, PHP, etc ... with a database MySQL, MongoDB, etc ... and so the mobile device is synchronized with the database that was the cloud.

Thus after a desktop client would connect to the webservice to bring the data in order to process it on your desktop client.

EDIT:

You can view this post's

Community
  • 1
  • 1
joselufo
  • 3,393
  • 3
  • 23
  • 37
  • Thanks for the reply. What you have suggested is a clean approach. but it was my bad that I forgot to mention that internet connection might not be available on the phone. – user3156301 Jul 04 '14 at 11:09
  • You can do the same scenario but on a local server and not have to use the internet. – joselufo Jul 04 '14 at 11:10
  • How will the device connect to local server? via USB? – user3156301 Jul 04 '14 at 11:13
  • Look this http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/ is an example of what I have explained above but on a local server. – joselufo Jul 04 '14 at 11:15
  • May be, I am missing something here. Thanks for sharing the link, will go thru it. But my question is how would the android application access the URL if there is no connectivity between the local server and the phone unless you are suggesting that local server/url can be accessed on connecting the phone to computer via usb. – user3156301 Jul 04 '14 at 11:30