Attempting to get the GPS coordinates in a HTML5 web page viewed with Necessitas's port of QWebView. However it always responds with Not Supported.
function load( )
{
if ( navigator.geolocation )
{
alert( "Supported." );
}
else
{
alert( "Not Supported!" );
}
}
I've altered the QWebPage to allow permissions:
BrowserWebPage::BrowserWebPage( QObject* parent ) : QWebPage( parent )
{
connect( this,
SIGNAL( featurePermissionRequested( QWebFrame*, QWebPage::Feature ) ),
SLOT( permissionRequested( QWebFrame*, QWebPage::Feature ) ) );
}
void BrowserWebPage::permissionRequested( QWebFrame* frame, QWebPage::Feature feature )
{
if ( feature == Geolocation )
{
setFeaturePermission( frame, feature, PermissionGrantedByUser );
}
else //denied
{
setFeaturePermission( frame, feature, PermissionDeniedByUser );
}
}
And set the following permissions:
android.permission.INTERNET
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
EDIT
According to this page the GeoLocation API is present within the QtWebKit build.
http://trac.webkit.org/wiki/QtWebKitFeatures22
DETAILS
Phone: Galaxy Nexus
Platform: Android 4.1.1 (SDK 14)
Framework: Qt 4.8.0 for Android armv7a