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. Failure to mount ext3 partition inside init.rc after loadable module

Hi,
I am trying to mount a formated ext3 partition on actual HW (zoom2 and
qualcomm)
  after insmod inside of init.rc but it fails to mount. I tried
different
  cases such as:
1. I did load module (insmod) followed by mount at user prompt;
   mount was successful.
2. I did load module (insmod) inside of init.rc and mount at user
propmt;
   again it is successful to mount.
3. Build the driver inside of kernel and do mount inside of init.rc;
   result is successful to mount
4. Try to Load module (insmod) followed by mount inside of init.rc;
   result is failure to mount.

My question is if there is any limitation to that in android
environment?
Would anybody have any suggestion to solve the issue of installing
loadable
module and mount at "init" section of the android initialization?
-Sean

2. Listen to Virtual Keyboard events when within an EditText

Hi guys,

this might be a pretty simple question, but I've tried several ways
without finding an answer...

I've set the following properties to the EditText to get the "Smiley"
Button which is used by the MessagingApp:

android:inputType="textShortMessage"
android:imeOptions="actionSend|flagNoEnterAction"

This works pretty fine... the button is there and it puts a smiley to
the EditText.

BUT: I would like to call my own Smiley Dialog (which is currently
triggered by a button), when this key is pressed!

So I've tried the OnKeyListener() on the EditText...

This method catches the backspace key and everything from 0-9. But it
refuses to catch any other key, so I am not able to get an event when
this "smiley" button is pressed.

Do you guys have any idea, how I could do this?

Thank you very much in advance!!!

Sascha

3. Trouble using NPN_PluginThreadAsyncCall and NPN_InvokeDefault to call back the browser from a native thread

4. Getting hold of a resource using generated string

5. Who are going to attend Google I/O?

6. Nexus One - Geocoder causes IOException - works perfectly with other devices and emulator

7. End of fling within Gallery