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" ;
    <uses-permission android:name="android.permission.INTERNET"/>

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

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


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;

        public void onCreate(Bundle savedInstanceState) {
        webView = (WebView) findViewById(R.id.webview);
        webView.loadUrl(" http://www.progettaremappeonline.it/test/ 
        webView.setWebChromeClient(new WebChromeClient() {
                 public void onGeolocationPermissionsShowPrompt(String origin,
android.webkit.GeolocationPermissions.Callback callback) {
                    callback.invoke(origin, true, false);


Thanks for helping!!


Other Threads

1. MyTouch Ion Magic rules

I had lost my Google Ion, for a couple weeks, so I retired my
Blackberry and bought a Droid.

The Droid is awesome, I believe it signifies the tipping point etc, it
is certainly the right phone for me now.

Although I would like to see HTC replaces the G1 with a phone that has
everything the G1 has, AND, a dpad useable with the keyboard, on T-
Mobile, with UMA WiFi voice and the HotSpot at HOme.  The can make a
conventional slider, the trackball need only be usable in portrait.

But I digress, I found my Google Ion!  It is certainly the best:

A. 1 Handed phone
B. MP3 player
C. Podcaster
D. 1 Handed web browser
E. 1 Handed device

I have ever used.  I have used plenty of iPhones, I won an iPod touch

Mind you, a physical keyboard is a prerequisite on my main device.  I
like to type fast, and no Apple product has been typable, from the tic
tac on.

I am heartened by how many good Android phones there are.   The
Samsungs and Cliqs seem to have solid keyboard.  I have heard bad
things about OpenGL on the Samsung though?

Can't wait to see what comes out round Christmas!  Will the Hero use
it's Flash capabilities at all, or will Flash seem unnecessary on

My 2 cents,

Matt Kanninen
What are you all working on this weekend?  I'm still working around
Bitmap Memory problems.


2. How can I embed a ListVIew in my layout xml


I have a layout xml file which embeds a ListView:
 <ScrollView android:layout_width="fill_parent"
        android:layout_height="0dip" android:layout_weight="1"
        <LinearLayout android:orientation="vertical"
          <!-- some text views, buttons, image views here --->
android:layout_height="wrap_content" />

I have an adapter to bind/build views for the ListView. It works okay
in portrait mode.
But when I rotate the device (the height of the screen is shorter, the whole
complete does not fit), there is a scroll bar in the ListView part of the
view.  How can I make it so that the scroll bar is for the WHOLE screen
instead of the ListView part of the view?

Thank you.


3. Start SDK Emulator fail!

4. how to Create cursor object with blob data?

5. Alpha Gradient on Bitmap of PNG

6. Custom android ANT tasks

7. Disabling landscape orientation for smallscreens