0

I'm trying to load a local url into webview, but I don't want to use the assets folder as this is read-only and I need to update the files from a web-service.

The web-service call is working fine and deposits the html files into a folder on the device using

File liveFolder = context.getDir("Live", Context.MODE_PRIVATE);

This creates a folder 'app_Live' in the app's storage space and fills it with html.

Now, when I come to load that into my Webview, the app says 'Website not available', even though liveFolder.isDir() returns true.

Also, on the 'Website not available' page it lists the attempted URL as:

/data/data/****MY PACKAGE NAME****/app_Live/buyers_guide/page1/index.html,

Which is completely correct and the file exists, checked using DDMS on ADT.

I have had the app working by loading assets from the android_asset folder, but this is no good to me as I need to be able to update the media.

Must be possible right?

Please help

1 Answer 1

0

Try adding this:

 filepath = yourfilepath;
 webview.loadUrl("file://"+filepath);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.