w3c geolocation working but prompt not showing

by geow » Thu, 19 May 2011 18:44:46 GMT


Sponsored Links
 Hi everybody, I am trying to embed a web app which uses google maps
JavaScript API and W3C geolocation in a Web View. The applicaion works
but it doesn't show any prompt for geolocation permission to the users
and I cant' find the problem. Here the AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=" http://schemas.android.com/apk/res/android" ;
      package="it.progettaremappeonline"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <application android:icon="@drawable/icon" android:label="@string/
app_name" android:debuggable="true" >
        <activity android:name=".bottegheActivity"
                  android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>


And here the java code:

package it.progettaremappeonline;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.GeolocationPermissions.Callback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;


public class bottegheActivity extends Activity {

        WebView webView;

        @Override
        public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        webView = (WebView) findViewById(R.id.webview);
        webView.setScrollBarStyle(webView.SCROLLBARS_INSIDE_OVERLAY);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setGeolocationDatabasePath("/data/data/");
        webView.loadUrl(" http://www.progettaremappeonline.it/test/ 
geolocation2.html");
        webView.setWebChromeClient(new WebChromeClient() {
                 public void onGeolocationPermissionsShowPrompt(String origin,
android.webkit.GeolocationPermissions.Callback callback) {
                    callback.invoke(origin, true, false);
                 }
                });

        }
}


Thanks for helping!!
Giac

-- 



Other Threads

1. Making submenus look like the expanded menu

Is this supported by the framework? I find the expanded menu look&feel
much more usable.

Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. android-platform is now partially moderated

We have recently turned on moderation control for the android-kernel
mailing list.  The goal is only to reduce the amount of spam on the
list, there is no plan for any active moderation or membership
control.

New memberships will still be granted automatically, there is no
intention to limit group membership, and new members will be able to
receive and read messages immediately.

For new members, your first post will be moderated.  Please allow 24
hours for your first post to go through, and please don't keep
reposting.  Once you have posted successfully, you will be allowed to
post freely.

I hope this improves things for all members of android-kernel.

--
Cdric
Google

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

3. How to execute a application automatically after android booting?

4. Problem when changing the default colors and drawables of Android

5. G1

6. Hessian Web Service and Android App

7. Cupcake's bug ? Caused by: android.content.res.Resources