Opening a system database

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

Opening a system database

Postby Legend » Tue Sep 29, 2009 1:57 am

Hi,

I was wondering if it is possible to open a system database (say, contacts.db) in Java. If so, can someone please point me to what I should provide in a call like this:

Code: Select all
db = this.openOrCreateDatabase(...)



I tried, data/data/com.google.android.providers.contacts/databases/contacts.db, but it doesn't work and complains about a slah being present in the filename. Any suggestions please?

Thanks
Legend
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Sep 29, 2009 1:04 am

Top

Postby padde » Tue Sep 29, 2009 2:20 am

I would say you simply cant open those system databases because you're not the owner
consequentially direct access is denied by the system.

Use the content providers to access those databases.
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby Legend » Tue Sep 29, 2009 3:45 am

Thank You. Would you mind pointing me to an example or a tutorial by any chance?

Thanks

EDIT:

Just got this:

Code: Select all
http://developer.android.com/guide/topics/providers/content-providers.html


I hope that is what you suggested... Thanks again :)
Legend
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Sep 29, 2009 1:04 am

Postby padde » Tue Sep 29, 2009 12:46 pm

Yes this is what i meant.. i believe there are some code samples too.
Or try searching the forum for keywords like "contacts" if i remember
right there are some posts where reading and writing contacts have
been discussed.
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 6 guests