As the documents said:

     If you are exposing byte data that's too big to put in the table
itself — such as a large bitmap file — the field that exposes the data
to clients should actually contain a content: URI string. This is the
field that gives clients access to the data file. The record should
also have another field, named "_data" that lists the exact file path
on the device for that file. This field is not intended to be read by
the client, but by the ContentResolver. The client will call
ContentResolver.openInputStream() on the user-facing field holding the
URI for the item. The ContentResolver will request the "_data" field
for that record, and because it has higher permissions than a client,
it should be able to access that file directly and return a read
wrapper for the file to the client.

I create a table like this:

Create TABLE test (_id INTEGER PRIMARY KEY, uri TEXT, _data TEXT);

And I INSERT INTO test VALUES (1, "content://com.test.aaa" , "/sdcard/
test.file");

Then I try to open OutputStream using this URI:

    getContentResolver().openOutputStream(Uri.parse("content://
com.test.aaa"));

but I got a filenotfound exception....

Did i do sth wrong about this. How to store the file correctlly?

And could I get a demo for this~

THX

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to