Voting: 
Vote up!
0 Votes
3 Replies
Unanswered

On Android, the heading from geolocation always comes back as 0

Question asked by matt trevathan on Apr 20, 2017 16:10 EDT

I implemented the sample code within the API documentaiton for the Goelocation API using the watchPosition method. When I print the heading out, it's always 0, no matter what the heading of my phone is. The heading should change if I change the direction the phone is pointing. It should not always be zero. I get accurate longitude and lattitude, but my applicaiton needs the heading to function properly.  Here is the callback from the API doc: function successcallback1(position) { lblTest.text = "working with watchPosition success full call back"; var geoPosition = "Latitude: " + position.coords.latitude; geoPosition = geoPosition + " Longitude: " + position.coords.longitude; geoPosition = geoPosition + " Altitude: " + position.coords.altitude; geoPosition = geoPosition + " Accuracy: " + position.coords.accuracy; geoPosition = geoPosition + " Altitude Accuracy: " + position.coords.altitudeAccuracy; geoPosition = geoPosition + " Heading: " + position.coords.heading; geoPosition = geoPosition + " Speeding: " + position.coords.speeding; geoPosition = geoPosition + " Timestamp: " + position.timestamp; alert(geoPosition); }   I'm currrently giving permissions to access_coarse_location, access_fine_location,access_checkin_properties, access_location_extra_commands, access_mock_location.

Vote up!
0 votes
Vote down!

Hi Matt,

Thank you for the detailed description of the issue. Please confirm the reported issue observed in which version of the Kony Studio. Is the app tested on the physical device or on the emulator?

Thanks

 

Replied by: Apr 21, 2017 03:50 EDT
Bronze
Vote up!
0 votes
Vote down!

I experienced the problem in 7.3 of Visualizer Enterprise on an LG G6. I also tried the same deployment on a samsung S7 with the same result.

Replied by: Apr 27, 2017 00:25 EDT
Vote up!
0 votes
Vote down!

Hello Matt,

We have created a sample app using KonyVisualizer Enterprise 7.3 version and we have observed the same behavior. We went ahead and we have created a native android application to check the API behavior in native. In native application also we are getting the Heading value as 0.

'heading' field corresponding to native Android API is getBearing() method of Location class. It seems that getBearing() will return 0 if that particular location does not have bearing. Please find the native application and APK file for your reference.

Hence this issue is not Kony platform issue, this is observed as device specific issue happening in the native application also. Request you to test the native application in your device and check the behavior. 

Thanks

Replied by: Apr 27, 2017 03:24 EDT
Bronze