Android - Access To Online Database Sqlite
Solution 1:
You should expose your datasource like this via an intermediary such as a Web Service for at least the following reasons:
- someone has direct access to your datasource and can read, manipulate or destroy the data
- abstraction; you can control the way in which the data is sent and how it's represented. Should the database tables/objects change, you'd only have to change the web service instead of force an update (in some cases)
- JSON interaction is very well supported on Android out of the box, whereas JDBC isn't (for previously documented reasons)
I'm sure there are plenty of more reasons, but the above are the most prevalent in my mind.
Solution 2:
There is no official support for JDBC on Android. There is a private SqlLite driver, but it's not recommended as it is unsupported and might go away in the future.
Read these:
http://groups.google.com/group/android-developers/browse_thread/thread/cf3dea94d2f6243c
http://code.google.com/p/sqldroid/
So the recommended way is to not use internal (private) SQlite driver and instead create a REST layer on server through which you access data. This is a recommended way as it minimizes load on device side and also gives you opportunity to create authentication on the server side - having publicly accessible JDBC connection is a big no-no.
Post a Comment for "Android - Access To Online Database Sqlite"