Android Question FusedLocationProvider - 2 tasks

FrankDev

Active Member
Licensed User
Longtime User
hi

im my application i use a progress like it is described in #2
https://www.b4x.com/android/forum/threads/fusedlocationprovider.50614/
(define a position, distance and a timer. (radius 200m, timer is 30 sec)
Get a 'LocationChanged' event-

from another task (second task) i need the actual position.
How to retreive the coordinates without disturbing the other process ?

Sometimes this task (second task) needs the position but the first process is not running and not initialized.

regards Frank
 

FrankDev

Active Member
Licensed User
Longtime User
hi Erel

thanks for your reply.

This solution works only if one assumes that the person does not move. - Or you accept a tolerance of 400m (in this example, radius = 200m).
As long as the person is not moving from the area - LocationChanged is not triggered. (the global variable is not updated)
If I come from 'Task2' (and read the global variable) I always have position the center (start). but the person could (now) also be at position a or positon b.
 

Attachments

  • position.jpg
    position.jpg
    54.2 KB · Views: 172
Upvote 0
Top