how do i store a static html page in android emulator and later on view it from WebView while running?
how do i store a static html page in andr开发者_Python百科oid emulator and later on view it from WebView while running?
I think the best way for accomplish your task is to use the assets folder:
- Create a toplevel folder named "assets"
- Put your static html files there
Load the html file with somethinh like this:
...
browser=(WebView)findViewById(R.id.webkit);
browser.loadUrl("file:///android_asset/yourpage.html");
...
Here is a good example on how to load a static page into a WebView: http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/
精彩评论