Search code examples
iphonegwtcordovageolocation

iphone gwtphonegap Geolocation always on


on gwtphonegap 1.7.0.0 (iPhone) i use the geolocation service to get the user's position only once in the beginning on the application

    GeolocationOptions options = new GeolocationOptions();
    options.setMaximumAge(1000);
    options.setEnableHighAccuracy(true);
    phoneGap.getGeolocation().getCurrentPosition(callback, options);

the call is made only once in the beginning and no update of the position is needed afterwards.

The problem is that when I run my application on iPhone, the GPS indicator on the status bar stays on all the time, even after I get the correct position. This may cause a useless battery usage.

Is there a way to tell the Geolocation service to stop after it gets the position?


Solution

  • It seems like we are missing the routines from the gwt phonegap implementation. I just rechecked and they are not part of the docs.

    I just posted an issue with the gwt-phonegap project: http://code.google.com/p/gwt-phonegap/issues/detail?id=57

    As a workaround you can drop to jsni and call the start / stop method directly.