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?

Thanks,
Anthony
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Paid apps in more countries - I am sick about it

Might be helpful if you state which country your in and want the paid market
to come to?

I'm in Ireland and to be honest Android is only starting to take off here so
there was no sense in having  a paid market here.

I believe by the end of the year there will be enough Android users to make
an Irish paid market worthwhile but its been quiet clean a paid apps market
in Ireland so far hasn't made sense.






> 

2. App not working properly on Motorola Droid and Blur

I have an app 'SMS Invite' (http://www.appbrain.com/app/
com.withoutcoffee.beta.smsinvite) on the Android Market which doesn't
seem to work properly on Motorola Droid and Blur. I tested it on HTC
Dream and Nexus One where I did not encounter any problems. The Droid
user told me that he is able to send invites but the replies don't get
automatically sorted into yes,no and maybe (the app checks the
incoming sms).
Has anyone else faced any problems with sending and receiving sms
using the api on Droid?
Thanks.

-- 

3. How to know Battery Level in android.

4. UUID association problem

5. Changing device locale doesn't restart application

6. Changing ringer mode to RINGER_MODE_SILENT doesn't prevent the phone from vibrating

7. Proxy settings