my android application needs to read from a database on the web and I have just no idea how am I supposed to do it.
I tried the following code:
SQLiteDatabase.CursorFactory cf = new SQLiteDatabase.CursorFactory() {
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery,
String editTable, SQLiteQuery query) {
// TODO Auto-generated method stub
return null;
}
};
SQLiteDatabase db =SQLiteDatabase.openDatabase("http://dakatora.co.il/locallhost", cf, SQLiteDatabase.OPEN_READONLY);
but it throws an exception
can someone please help me?
You can not access database directly from an android device (without a lot of hard work and “hackish” ways). You should never use a direct connection to a outside database. Using a web service is a a lot safer.
Also you could try something like this: Interacting with external SQLite databases from Android.