You can use a ContentProvider to serve files. See the openFile() method.

On Mon, Jun 14, 2010 at 10:51 AM, Moto <[email protected]> wrote:
> From what I searched before, ContentProvider is only for allowing
> Database access to your app from other apps...  In your case I'm not
> sure you would want to use a ContentProvider to access files...  You
> might be able to hack it but I wouldn't recomend it...  Try a
> service...  Maybe inside the service open a proxy to listen for
> incoming requests... :)
>
> -Moto
>
> On Jun 13, 12:35 pm, Alex Xin <[email protected]> wrote:
>> Hi, All
>>
>> I'm now trying to implement my own content provider. My original data was
>> stored on network or local/remote file systems, so I want to provide data
>> via input stream. I know that client may call ContentResolver.getnputStream
>> to retrieve the input stream to access data. But I don't know how to
>> implement content provider in this situation, I searched the Internet but
>> all the tutorials for content provider are talks about how to expose data
>> that stored on local database.
>>
>> Could anyone please help me on this or give me some code snippets to show
>> how to expose data that stored on file systems using a content provider?
>>
>> Also could anyone please tell me what happened when client
>> call ContentResolver.getnputStream? I want to know how to return an input
>> stream to my client.
>>
>> Thank you
>>
>> Alex
>
> --
> 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
>



-- 
Mark Murphy
CommonsWare
[email protected]
http://commonsware.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