Why must WebView display local files via a ContentProvider?

by Biosopher » Thu, 06 Nov 2008 02:02:54 GMT

Sponsored Links
 In case you hadn't heard, WebView won't display local files directly
via loadUrl("file://YOUR_PATH/file.html).  All the solutions create a
ContentProvider to access the local files and send them to a WebView
using ContentProvider.openFile().

This approach seems less secure than simply sending my locally created
application files files directly to WebView.  My app creates and
stores the files in my sandboxed local file directory so they should
be inaccessible to anyone and thus secure.

I know the standard response for why this is:  "That WebView's access
to local files would be insecure".

But why is it safer to wrap files into a ContentProvider and then feed
them to WebView when the purpose of a ContentProviders is mostly to
share content between apps.. .which I won't be doing?

So my questions:
1) What was wrong with the local file solution for WebView.loadUrl().
2) Why is it safer to wrap my local files into a ContentProvider?


Other Threads

1. Execute an activity repeatedly after a definite interval of time

I have an activity imageCapture.java which extends activity and takes
pictures.I want to execute this activity repeatedly after a definite
interval of time.

I can't figure out how to do this...!!Do I need to make ImageCapture a

This is what I want to do...As soon as the user press start I want to
keep taking pictures in the background..When the user presses stop,it
should stop image capture.java.

I am so lost...
Someone please help me out!

2. 1.5 NDK finally available :-)

see blog post here:

This looks very cool!



3. 5 hardware buttons?

4. Google I/O 2008 - Dalvik VM Internals - implicit labeling

5. Add gprof support to bionic

6. Efficiently drawing destructable terrain

7. How to connect external webcam