incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-603) Phonegap didn't trigger GPS
Date Thu, 10 May 2012 16:32:50 GMT

    [ https://issues.apache.org/jira/browse/CB-603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272463#comment-13272463
] 

Joe Bowser commented on CB-603:
-------------------------------

Part of the reason you don't use GPS by itself for Geolocation is because inside it tends
to not actually work.  If you use the low accuracy cell-tower version, you'll actually get
a location.  Using high accuracy causes my GPS to actually turn on, however I'll have to actually
go outside if I want to get a reading that's not total garbage with my Galaxy Nexus.

BTW: We use the same Geolocation code as the Android browser.  We also have our own version
of Geolocation, but it also doesn't contradict the laws of physics.  Also, I'm not getting
any SQLite errors on my phone related to Geolocation.
                
> Phonegap didn't trigger GPS
> ---------------------------
>
>                 Key: CB-603
>                 URL: https://issues.apache.org/jira/browse/CB-603
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.6.0, 1.6.1, 1.7.0
>            Reporter: Lucas Falk Beier
>            Assignee: Joe Bowser
>              Labels: android, geolocation, gps, phonegap
>
> I'm trying to get my position with GPS.
> I just implement the "Full Example" from here: http://docs.phonegap.com/en/1.6.1/cordova_geolocation_geolocation.md.html#Geolocation
> I tested with 1.6.0, 1.6.1 and 1.7.0rc1.
> The problem: app didn't trigger the GPS to get my current position. Even when I check
"Data enable".
> Here is my code:
> <!DOCTYPE html>
> <html>
>   <head>
>     <title>Device Properties Example</title>
>     <script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
>     <script type="text/javascript" charset="utf-8">
>     // Wait for Cordova to load
>     //
>     document.addEventListener("deviceready", onDeviceReady, false);
>     // Cordova is ready
>     //
>     function onDeviceReady() {
>         navigator.geolocation.getCurrentPosition(onSuccess, onError);
>     }
>     // onSuccess Geolocation
>     //
>     function onSuccess(position) {
>         var element = document.getElementById('geolocation');
>         element.innerHTML = 'Latitude: '           + position.coords.latitude       
      + '<br />' +
>                             'Longitude: '          + position.coords.longitude      
      + '<br />' +
>                             'Altitude: '           + position.coords.altitude       
      + '<br />' +
>                             'Accuracy: '           + position.coords.accuracy       
      + '<br />' +
>                             'Altitude Accuracy: '  + position.coords.altitudeAccuracy
     + '<br />' +
>                             'Heading: '            + position.coords.heading        
      + '<br />' +
>                             'Speed: '              + position.coords.speed          
      + '<br />' +
>                             'Timestamp: '          + new Date(position.timestamp)   
      + '<br />';
>     }
>     // onError Callback receives a PositionError object
>     //
>     function onError(error) {
>         alert('code: '    + error.code    + '\n' +
>               'message: ' + error.message + '\n');
>     }
>     </script>
>   </head>
>   <body>
>     <p id="geolocation">Finding geolocation...</p>
>   </body>
> </html>
> And the XML file:
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
>     package="com.phonegap.helloworld"
>     android:versionCode="1"
>     android:versionName="1.0" >
> <supports-screens
> android:largeScreens="true"
> android:normalScreens="true"
> android:smallScreens="true"
> android:resizeable="true"
> android:anyDensity="true"
> />
> <uses-permission android:name="android.permission.CAMERA" />
> <uses-permission android:name="android.permission.VIBRATE" />
> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
> <uses-permission android:name="android.permission.INTERNET" />
> <uses-permission android:name="android.permission.RECEIVE_SMS" />
> <uses-permission android:name="android.permission.RECORD_AUDIO" />
> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
> <uses-permission android:name="android.permission.READ_CONTACTS" />
> <uses-permission android:name="android.permission.WRITE_CONTACTS" />
> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
> <uses-permission android:name="android.permission.BROADCAST_STICKY" />
>     <uses-sdk android:minSdkVersion="7" />
>     <application
>         android:icon="@drawable/ic_launcher"
>         android:label="@string/app_name" >
>         <activity
>             android:name=".App"
>             android:label="@string/app_name"
>             android:configChanges="orientation|keyboardHidden">
>             <intent-filter>
>                 <action android:name="android.intent.action.MAIN" />
>                 <category android:name="android.intent.category.LAUNCHER" />
>             </intent-filter>
>         </activity>
>         <activity android:name="org.apache.cordova.DroidGap" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"> <intent-filter> </intent-filter>
</activity>
>     </application>
> </manifest>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message