views:

205

answers:

2

Hi,

can anybody tell how to run the local webapplication using android webview

I want to run my own webpages in android using web view

Thanks

A: 

Just run your application on the emulator, as you normally do (and be sure to have your computer connected to internet).

BennySkogberg
+2  A: 

I'm guessing you want something like this:

private WebView mWebView;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.yourLayoutWithAWebView);

    mWebView = (WebView)findViewById(R.id.yourWebViewIdFromTheLayout);
    mWebView.getSettings().setJavaScriptEnabled(true); // Enable JavaScript

    mWebView.loadData(yourHtmlData, "text/html", "utf-8");
}

Hopefully, that at least points you in the right direction.

Also, I'd recommend reading the documentation on the WebView, it's pretty thorough.

kiswa