Two things i can think of. First make sure your WebChromeClient has
an over ride for onJsAlert.
The next part is tricky. If you have android 2 you can't use gears/
but u can use the w3c spec for 'navigator.geolocation'. but you still
need to enable a few things in code.
in your webcromeclient again.
override onGeolocationPermissionsShowPrompt
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
Callback callback) {
// TODO Auto-generated method stub
super.onGeolocationPermissionsShowPrompt(origin, callback);
callback.invoke(origin, true, false);
}
next in your activity
MyWebChromeClient mwcc = new MyWebChromeClient ();
mWebView.setWebChromeClient(mwcc );
mwcc.onGeolocationPermissionsShowPrompt('', this);
and make your activity
implements GeolocationPermissions.Callback
and finally
add an invoke for that call back.
public void invoke(String origin, boolean allow, boolean remember) {
// TODO Auto-generated method stub
}
not sure if its 100% safe, but this is what i use.
let me know if you find a way to get gears back in the webview.
-w
On Jun 8, 2:36 pm, guruk <[email protected]> wrote:
> Hi,
> i made a testhttp://www.checkdent.com/mobile/gps2.html
> based on the
> demo:http://code.google.com/apis/gears/api_geolocation.html#getpermission
>
> when i open it from android browser i get my location.
> but opened from within a webview, nothing happens??
>
> i already gave several permissions
> <uses-permission android:name="android.permission.INTERNET"></uses-
> permission>
> <uses-permission
> android:name="android.permission.ACCESS_COARSE_LOCATION" />
> <uses-permission
> android:name="android.permission.ACCESS_FINE_LOCATION" />
> <uses-permission
> android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></
> uses-permission>
>
> but still no success!
>
> what do i have to do?
>
> thx
> chris
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en