Android - Access to online Database SQlite

前端 未结 2 1546
礼貌的吻别
礼貌的吻别 2021-01-18 23:44

I need to open, read and insert items into an online SQLite database from an Android app.
I know url, username and password. In JavaSE i would do the fo

2条回答
  •  Happy的楠姐
    2021-01-19 00:28

    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:

    Does Android Support JDBC

    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.

提交回复
热议问题