I wonder if it's possible to compile an android app with web data already included in apk for offline use. Application downloads data (HTML), saves on device(HTML and images separately) and displays it in webview, but I wonder if it's possible to compile this app with all data and pictures already in device.
Asked
Active
Viewed 179 times
2 Answers
0
WebView mWebView=(WebView)findViewById(R.id.mWebView);
mWebView.loadUrl("file:///book.html");
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSaveFormData(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.setWebViewClient(new MyWebViewClient());
private class MyWebViewClient extends WebViewClient
{
@Override
//show the web page in webview but not in web browser
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl (url);
return true;
}
}
For More information
http://androidtrainningcenter.blogspot.in/2012/11/android-webview-loading-custom-html-and.html

Mina Fawzy
- 20,852
- 17
- 133
- 156
-
I think he want load data from html file already downloaded in his files(apk) , custom html if he want control his webview – Mina Fawzy Nov 05 '14 at 10:12
0
Since I store all the data in database all I have to do is go through all the categories I want be available offline at app install, store the db file in /assets/ folder and then once user launches the app for the first time use copy method from here How to put .db file from assets to data/data/packagename/ android and I'm all set. Hope this helps someone else.

Community
- 1
- 1

user3783123
- 544
- 3
- 15