Sereja & Pavel,

It should be just a little bit more involved than writing a SQL-based one.

For structured data, you'd need to create your own Cursor subclass, and return it from the provider's query method. If query results are small enough to fit in RAM, then it's easiest to use MatrixCursor.

For stream-based data, ContentResolver.openStream seems to eventually call ContentProvider<subclass>.openFile. This method returns a special helper class, ParcelFileDescriptor, which allows file descriptors to be passed across process boundaries.

-- Kostya

16.08.2010 17:18, Paul Turchenko пишет:
They use Database! Sergey is asking about building content provider
around non-db storage.

On Aug 16, 4:29 am, Indicator Veritatis<[email protected]>  wrote:
Expect to override a lot more methods in ContentProvider and
ContentResolver than other people do. You may want to look at the
example WidgetExplorer from "Unlocking Android". Go to the book's
website, download the sample code and look in the code for chapter 5.

I suggest this example because here too, the authors override more
methods than usual because they are making their own ContentProvider.
But of course, the example will not be exactly the same as what you
want.

On Aug 12, 2:45 pm, Sergey<[email protected]>  wrote:

Hi,
I need to write a ContentProvider to provide a dynamically generated
audio stream to be playable by MediaPlayer. That is MediaPlayer will
use ContentResolver.openInputStream() to play it.
I have read a lot of discussions about this problem but no one had a
solution yet.
The most recent one was in January 
2010:http://groups.google.com/group/android-developers/browse_thread/threa...
Have anyone found a solution yet?
Any ideas are greatly appreciated.
Thanks a lot,
--Sergey


--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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