I want to access to this path on android.
/data/data开发者_开发百科/com.android.providers.contacts/databases/contacts2.db
but i could not.i think because it s private.but i want to backup it and will restore it.
my phone in root.but i could not do that too.
what should i do?
thanks and regards
I don't think the database was meant to be accessed directly. Have you looked at the Content Providers?
finally i found a way.
first your phone should be root!
and second step is to change contacts2.db
permissions.
for that use below codes :
Process p;
p = Runtime.getRuntime().exec("su");
p = Runtime.getRuntime().exec("chown root.root /data/data/com.android.providers.contacts/databases/contacts2.db");
p = Runtime.getRuntime().exec("chmod 777 /data/data/com.android.providers.contacts/databases/contacts2.db");
and after that you can access to it!
精彩评论