Thanks Mark & Moto :) my final goal is that I want to provide video/audio/image data to right handlers, of course those data are stored on network file server running SMB sharing service or local file systems.
Sorry I still have questions: >From Mark's reply I know that maybe I need to implement my own openFile(), this function will return an instance of ParcelFileDescriptor object, in my case I don't know how to create this object. On Mon, Jun 14, 2010 at 10:58 PM, Mark Murphy <mmur...@commonsware.com>wrote: > You can use a ContentProvider to serve files. See the openFile() method. > > On Mon, Jun 14, 2010 at 10:51 AM, Moto <medicalsou...@gmail.com> 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 <xinxi...@gmail.com> 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 android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > > > > > -- > Mark Murphy > CommonsWare > mmur...@commonsware.com > 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 android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en