2

I want to open a remote sqlite database with a url such as:

http://www.mysite.com/db.sqlite

Can I use SQLiteDatabase.openDatabase() for this? If not, what's the right way to do it?

user229044
  • 232,980
  • 40
  • 330
  • 338
gonzobrains
  • 7,856
  • 14
  • 81
  • 132

2 Answers2

2

It needs to be a file on the device or SD card.

Official Android Docs

0

I don't think you can use it for remote sqllite database call. When your database is remote, you will end up making web service call to service hosted on your database server, which returns either XML/JSON formatted data.

kosa
  • 65,990
  • 13
  • 130
  • 167
  • Yeah, I was just thinking about it. I don't think you can remotely query SQLite databases because they are just flat files, right? Well, Ideally I'd like to download the database locally but it is large and I haven't found a great way to download it fast enough to keep the user from getting annoyed! – gonzobrains Feb 13 '12 at 22:46
  • May be one way is keep populating local database as need basis. – kosa Feb 13 '12 at 22:48
  • @gonzobrains If it's possible to install a "baseline" database with the app, synchronizing it with the server may not take as long. But I guess that's not always an option. – Joachim Isaksson Feb 13 '12 at 22:48