not able to open mmssms db from contact provider

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

not able to open mmssms db from contact provider

Postby surendar » Tue Jul 07, 2009 6:49 am

Hi All ,

This command i am using to attach mmssms db in contact provider.

db.execSQL("Attach database "/data/data/
> > com.android.providers.telephony/databases/mmssms.db" as mmssms_db;" )

when i try to run the code on target it's giving me error like :

I m gettin Error 14 : "Failed to open database file "/data/data/
> > com.android.providers.telephony/databases/mmssms.db" - unable


on simulator it's working fine. I can read all the tables from contact provider.but i dont kno why it's not working on target.

Please help me to resolve this issue. Is there anything wrong witn path or permission , or with my system images.
I am totally confused what is the problem.
surendar
Freshman
Freshman
 
Posts: 2
Joined: Mon Feb 23, 2009 4:47 pm

Top

ContentProviders.

Postby codevalley » Tue Jul 07, 2009 6:36 pm

I don't think you can directly access the system databases like that. For that matter, any database which is not created by your application.
For cross application database sharing we have ContentProviders.
You can use something like this to open the smsmms database
Code: Select all
Cursor cSys = getContentResolver().query("content://mms-sms",null, null, null,null);

Using this cursor you can manipulate the database.
You have more Uri's like
Code: Select all
content://mms-sms
content://mms
content://sms
content://sms/inbox
//etc
http://thecodevalley.com
Your daily byte of technology.
codevalley
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Jul 05, 2009 5:37 am
Location: India

Postby surendar » Wed Jul 08, 2009 6:54 pm

Thanks for reply.
[fade]
I don't think you can directly access the system databases


but then how it's working in simulator?? there is no problem in simulator.
surendar
Freshman
Freshman
 
Posts: 2
Joined: Mon Feb 23, 2009 4:47 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 1 guest