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. 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
etc.

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
Android.

My 2 cents,

Matt Kanninen
http://www.myspace.com/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

Hi,

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

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