I have an application that works in Seattle, but migrating it to Tokyo 10.2.3 does not work .

I have an application that works in Seattle, but migrating it to Tokyo 10.2.3 does not work .

I have a routine that collects the GPS position in certain events, for this I have created a listener of the
LocationManager and I call the FLocationManager.requestLocationUpdates.

In seattle, when calling the function the system was executing the location, I do a while to wait for the capture position,
but in Tokyo, when calling the Location it ends after the while.

Testing on Android 4.4 and Android 5.1

Can someone help me with this problem already did everything that is tests and did not work.


//Put in task, or not same result
T := TTask.Run (procedure
begin
if FLocationManager.isProviderEnabled(TJLocationManager.JavaClass.GPS_PROVIDER) then
FLocationManager.requestLocationUpdates(TJLocationManager.JavaClass.GPS_PROVIDER, 15000, 1, LocationListener, TJLooper.JavaClass.getMainLooper );
end);

//In Seattle he calls the RequestLocation and starts capturing the location in //Tokyo
//when calling the RequestLocation, it does not capture the location, only after //the while the system captures location

while (vLerPosicaoGPS = True ) and (vtentativas <= 20 ) do
begin
sleep(200);
Inc(vtentativas);
Edit2.Text := IntToStr(vTentativas);
Application.ProcessMessages;
end;



Thank you
https://1drv.ms/u/s!AoFsefnVpVA6ghX1Nw_omDR9shyK

Comments

  1. Eli M Thanks Eli, in the example I put the attachment uses the same example code to instantiate the listenerlocation, however my difficulty is in returning to the location for the call of a function, which I use in every projects, GetLocation, this works perfectly in Seattle, but in Tokyo, I can not capture this return, outside the callback, OnLocationChange, because I have several applications with this same rule, if I have to rewrite all, (I did not see any other alternative), I'm thinking of other possibilities.

    ReplyDelete
  2. Marcio Eduardo Reis I am afraid there is no way around it. You will have to do a rewrite.

    ReplyDelete

Post a Comment