i was searching for a way to zoom for both text and picture in my layout. according to some questions web view is a easy way to do it. after a while i found this code for webview:
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class WebViewActivity extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
}
}
i tried to use file:///
instead of http://
so i used this path:
file:///sdcard/Android/data/[My App Package Name]/about.html
it seems its working fine for me, but i have some serious problems.
here is my problems:
- is this path i am using is works for all other android devices?
- i dont know how to extract html files for the first run in to that path i am using.
- is there anyway to load the files from assets?
- what is the source code for extract files in first run?
- can i use other formats like pdf or doc instead of html? if i couldnt what should i change in the source code?
thank guys for helping me. should i give up or continue this idea?