F FrankDev Active Member Licensed User Longtime User Jul 29, 2017 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2017 #2 Store the location in a process global variable. In the second process you should check whether Location.IsInitialized returns true before you access it. Upvote 0
Store the location in a process global variable. In the second process you should check whether Location.IsInitialized returns true before you access it.
F FrankDev Active Member Licensed User Longtime User Jul 30, 2017 #3 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 54.2 KB · Views: 381 Upvote 0
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.
Erel B4X founder Staff member Licensed User Longtime User Jul 31, 2017 #4 If you are using B4A v7+ then you can wait for the value to be available: Code: Copy Do While ValueIsNotAvailable Sleep(100) Loop 'value is available here Upvote 0
If you are using B4A v7+ then you can wait for the value to be available: Code: Copy Do While ValueIsNotAvailable Sleep(100) Loop 'value is available here
F FrankDev Active Member Licensed User Longtime User Aug 1, 2017 #5 hi Erel, thanks for your answer. i use v7+ i'll try regards Frank Upvote 0