File API only supports SDCARD?

55 views
Skip to first unread message

EniGMistA

unread,
Jun 3, 2012, 4:51:54 AM6/3/12
to phonegap
How can i Read into /data/data/com.android.providers.contacts/
databases and list files in it?

Simon MacDonald

unread,
Jun 3, 2012, 5:20:00 PM6/3/12
to phon...@googlegroups.com

You can only do this if you root your phone. Normally you would not have the right permissions on your device.

Simon

On Jun 3, 2012 4:52 AM, "EniGMistA" <enigmi...@gmail.com> wrote:
How can i Read into /data/data/com.android.providers.contacts/
databases and list files in it?

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

EniGMistA

unread,
Jun 4, 2012, 5:42:16 AM6/4/12
to phonegap
Thanks Simon. But i need a solution to fix my problem into Android:
when i update my phonebook thougth CONTACT APIs with a loop, a
temporary file /data/data/com.android.providers.contacts/databases/
contacts2.db-journal was created. I can access into my phonebook only
when this file disappear. How can i check this?
EniGMistA

Simon MacDonald

unread,
Jun 4, 2012, 9:26:54 AM6/4/12
to phon...@googlegroups.com
That is the problem. On Android all the applications are given their own /data/data directory that is protected with a different user id for each application. If you are running application "com.foo" you will not have the right privileges to access the /data/data/com.android.providers.contacts/databases as they are owned by two different user id's. The only way you'd be able to get access to this directory is if your phone was rooted.

It is the sqlite DB creating the journal file. I guess the transaction is not completed until the file is completely processed and removed. I don't think we can do anything about this in PhoneGap. In the native implementation for editing/saving a contact I'm applying a batch edit to the DB. When it is done it returns the number of rows modified so it should be done at that point but it appears that it isn't.

Simon Mac Donald
http://hi.im/simonmacdonald


EniGMistA

unread,
Jun 4, 2012, 11:22:15 AM6/4/12
to phonegap
> It is the sqlite DB creating the journal file. I guess the transaction is
> not completed until the file is completely processed and removed. I don't
> think we can do anything about this in PhoneGap. In the native
> implementation for editing/saving a contact I'm applying a batch edit to
> the DB. When it is done it returns the number of rows modified so it should
> be done at that point but it appears that it isn't.

Will be a feature of next phonegap version?

Simon MacDonald

unread,
Jun 4, 2012, 12:34:24 PM6/4/12
to phon...@googlegroups.com
I'm confused? 

EniGMistA

unread,
Jun 4, 2012, 2:13:58 PM6/4/12
to phonegap
I am sorry. Google translate tells me that you are working on
phonegapp to implement numer of rows affected from a previous edit.
I am confused... how can I check when PhoneGap has finished to save
all the contacts?

Simon MacDonald

unread,
Jun 6, 2012, 1:29:55 PM6/6/12
to phon...@googlegroups.com
No, the functionality I described is already implemented. I'm not sure why Android is falsely saying the save is done if the journal file is still being applied.
Reply all
Reply to author
Forward
0 new messages