android - SQLiteDatabase open specific database with path -


i want open database contains sms , mms messages. want cause need make raw query need work. trying this:

    try{       sqlitedatabase sqlitedatabase = sqlitedatabase.opendatabase("/data/data/com.android.providers/telephony/databases/mmssms.db", null, sqlitedatabase.open_readwrite);     }catch(exception e){        e.printstacktrace();     } 

and error this:

07-15 10:13:11.784: e/sqlitelog(13014): (14) cannot open file @ line 30176 of [00bb9c9ce4] 07-15 10:13:11.784: e/sqlitelog(13014): (14) os_unix.c:30176: (2) open(/data/data/com.android.providers/telephony/databases/mmssms.db) -  07-15 10:13:12.084: e/sqlitedatabase(13014): failed open database '/data/data/com.android.providers/telephony/databases/mmssms.db'. 07-15 10:13:12.084: e/sqlitedatabase(13014): android.database.sqlite.sqlitecantopendatabaseexception: unknown error (code 14): not open database 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnection.nativeopen(native method) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnection.open(sqliteconnection.java:209) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnection.open(sqliteconnection.java:193) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnectionpool.openconnectionlocked(sqliteconnectionpool.java:463) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnectionpool.open(sqliteconnectionpool.java:185) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqliteconnectionpool.open(sqliteconnectionpool.java:177) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqlitedatabase.openinner(sqlitedatabase.java:804) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqlitedatabase.open(sqlitedatabase.java:789) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqlitedatabase.opendatabase(sqlitedatabase.java:694) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.database.sqlite.sqlitedatabase.opendatabase(sqlitedatabase.java:669) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ ppm.messenger.androidppmmessenger.mainactivity.oncreate(mainactivity.java:62) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activity.performcreate(activity.java:5104) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2144) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activitythread.access$600(activitythread.java:141) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.os.handler.dispatchmessage(handler.java:99) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.os.looper.loop(looper.java:137) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ android.app.activitythread.main(activitythread.java:5041) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ java.lang.reflect.method.invokenative(native method) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ java.lang.reflect.method.invoke(method.java:511) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) 07-15 10:13:12.084: e/sqlitedatabase(13014):    @ dalvik.system.nativestart.main(native method) 07-15 10:13:12.094: w/system.err(13014): android.database.sqlite.sqlitecantopendatabaseexception: unknown error (code 14): not open database 07-15 10:13:12.094: w/system.err(13014):    @ android.database.sqlite.sqliteconnection.nativeopen(native method) 07-15 10:13:12.104: w/system.err(13014):    @ android.database.sqlite.sqliteconnection.open(sqliteconnection.java:209) 07-15 10:13:12.116: w/system.err(13014):    @ android.database.sqlite.sqliteconnection.open(sqliteconnection.java:193) 07-15 10:13:12.124: w/system.err(13014):    @ android.database.sqlite.sqliteconnectionpool.openconnectionlocked(sqliteconnectionpool.java:463) 07-15 10:13:12.134: w/system.err(13014):    @ android.database.sqlite.sqliteconnectionpool.open(sqliteconnectionpool.java:185) 07-15 10:13:12.134: w/system.err(13014):    @ android.database.sqlite.sqliteconnectionpool.open(sqliteconnectionpool.java:177) 07-15 10:13:12.147: w/system.err(13014):    @ android.database.sqlite.sqlitedatabase.openinner(sqlitedatabase.java:804) 07-15 10:13:12.147: w/system.err(13014):    @ android.database.sqlite.sqlitedatabase.open(sqlitedatabase.java:789) 07-15 10:13:12.154: w/system.err(13014):    @ android.database.sqlite.sqlitedatabase.opendatabase(sqlitedatabase.java:694) 07-15 10:13:12.166: w/system.err(13014):    @ android.database.sqlite.sqlitedatabase.opendatabase(sqlitedatabase.java:669) 07-15 10:13:12.174: w/system.err(13014):    @ ppm.messenger.androidppmmessenger.mainactivity.oncreate(mainactivity.java:62) 07-15 10:13:12.174: w/system.err(13014):    @ android.app.activity.performcreate(activity.java:5104) 07-15 10:13:12.185: w/system.err(13014):    @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 07-15 10:13:12.194: w/system.err(13014):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2144) 07-15 10:13:12.194: w/system.err(13014):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 07-15 10:13:12.204: w/system.err(13014):    @ android.app.activitythread.access$600(activitythread.java:141) 07-15 10:13:12.214: w/system.err(13014):    @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 07-15 10:13:12.224: w/system.err(13014):    @ android.os.handler.dispatchmessage(handler.java:99) 07-15 10:13:12.234: w/system.err(13014):    @ android.os.looper.loop(looper.java:137) 07-15 10:13:12.234: w/system.err(13014):    @ android.app.activitythread.main(activitythread.java:5041) 07-15 10:13:12.244: w/system.err(13014):    @ java.lang.reflect.method.invokenative(native method) 07-15 10:13:12.244: w/system.err(13014):    @ java.lang.reflect.method.invoke(method.java:511) 07-15 10:13:12.254: w/system.err(13014):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) 07-15 10:13:12.284: w/system.err(13014):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) 07-15 10:13:12.294: w/system.err(13014):    @ dalvik.system.nativestart.main(native method) 

i want know how open database correctly.

your question not new. looks need information how connection database-servers working.

answer given here


Comments