Position.enableLocationEvents not calling the method

Hi all,

I have an App working well.

At the start, this App uses Position.enableLocationEvents to get the initial position of the device. This is working perfect.

Now, I am trying to add the possibilities for the users to acquire a new start position. I use the same methodology as before, but the methods onForcedPosition is simply never ever not called.

Any help is welcome... 

onUpdate()

if (ForceAcquisition==true) {

            Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onForcedPosition));
            ForceAcquisition=false;}
function onForcedPosition(info) {
        System.println("PLEASE SHOW ME YOU WORk");
        InitialLoc = info.position.toRadians();
        Storage.setValue("PositionLat", InitialLoc[0]);
        Storage.setValue("PositionLon", InitialLoc[1]);
        Storage.setValue("DateDZAcquired", GPSFixDateString);
    }

Top Replies

  • I tried both Conti and one_shoot but nothing. The methods is simply not called, whatever the method. I also tried to move the Position.enableLocationEvents in different location, but nothing…

All Replies

  • Take a look at the recordsample in the SDK.  In that case, it enables GPS in onStart() in the AppBase, and the callback is also in Appbase(). (onPosition()).

    Put a println in onPosition() and make sure you are seeing those when feeding in data to the sim. 

    What you are seeing isn't a general problem, as I use GPS in a number of my widgets and device apps.