I'm refactoring code cause I made a huge number of tests before
getting something right.
I'll post it ASAP.
Thank you for your support.
On 9 Set, 20:10, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> 2008/9/9 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
>
>
> > Yes... I was trying to do that.
> > I am creating ContentProvider which stores data in a table with (for
> > now) only 2 fields:
> > _id (unique identifier)
> > _data (a String which stores the full path of the file)
> > I was unable to call openInputStream or openOutputStream on the Uri
> > cause of documentation was not notifying that it is necessary to
> > override openFile method into ContentProvider.
>
> Thanks for the pointer ...we will add this to the docs..
>
>
>
> > Within the openFile method, I am manually executing a query to get the
> > path of the file associated to the requested content and returning the
> > ParcelFileDescriptor.
>
> Yes that is the correct way ...
>
>
>
> > Now it is working... Maybe I made something wrong with database
> > declaration.
> > That would be perfect if Google releases MediaProvider sources...
> > I hope so.
>
> I am not sure how MediaProvider is relevant here...
>
>
>
> > Resume:
> > Create a content provider having _data field.
> > Implement all the required methods.
> > [* I don't know if I made something wrong with query method
> > implementation] Override openFile method.
> > You'll be able to load your content via
> > WebViewElement.loadUrl("content://yourcontentprovider/#");
>
> It will be helpful to everyone facing the same issue with displaying local
> files in WebView,
> if you could share your sample code.
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---