tags:

views:

67

answers:

2

I have some web pages that I want to bundle with my Android application and display as static pages. Where do I put them? How do I access them? I'm working in Eclipse, so I want a solution that automatically bundles them.

I've tried putting my web pages in res/raw, and I can read them as an input stream from there, so I could push that into a WebView. But I'd really prefer if I could stick them somewhere and access them with a URL. I've tried file:///android_asset/about.html but that didn't work. Surely there's a way to form a URL to display bundled pages.

+3  A: 

Put them into the "assets" folder and do:

webview.loadUrl("file:///android_asset/file.html");
Loxley
A: 

I am having the same problem, except, I did put my file.html file inside the "assets" folder. At the moment my project root looks like this

AndroidManifest.xml test assets build build.xml dist manifest.mf nbproject res src

However if I try to load the url as "file:///android_asset/file.html" it says the webpage cannot be found?

Jose Garcia