开发者

Android website doesn't show up in webview

I am trying to show maps.google.com website thru WebView in Android emulator but I am not seeing the web site and seeing only Loading.

I am able to see other sites like www.google.com. Do I need to enable more settings for sites like maps.google.com?

Permission in the manifest

<uses-permission android:name="android.permission.INTERNET" />

Code

            WebView view= (WebView) findViewById(R.id.view1);
            View.getSettings().setJavaScriptEnabled(true);
            View.getSettings().setBuiltInZoomControls(true); 
            View.getSettings().setSupportZoom(true);
            View.l开发者_开发问答oadUrl("http://maps.google.com");


please try to run simulator with google api instead of normal simulator, i am sure you got it.

it may help you.


You should use MapView instead of a WebView. It gives you much better control over the map. You'll need to get an apiKey from google, associated with the keystore you're using (it only takes a minute to do that), but it's worth the trouble. Just remember that if you're running it straight out of eclipse (rather than as an installed .apk) you'll also need to get an apiKey associated with your eclipse debug keystore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜