Hi all,
I'm experimenting with the GPS library (v. 1.11, maye due to B4A v. 2.71) and came across to what appears a somewhat strange behaviour.
As per Erel definition (see GPS tutorial):
GPS_UserEnabled (Enabled As Boolean)
This event is raised whenever the user changes the status of the GPS device. It is also raised right after calling Start.
Now, what I found so far is that if the user disables the GPS service when we're in a GPS.Stop status then no GPS_UserEnabled event is raised.
I expected that event to be raised with Enabled = False in order to signal the app that GPS service is no more available.
The Enabled = False setting appears as expected when the user disables the GPS service when in the GPS.Start condition.
Summarizing it all in a (kind of) truth table, I have:
Starting condition Action UserEnabled event Enabled var
GPS_Serviceff GPS_Servicen called True
GPS_Servicen + GPS.off GPS.Start called True
GPS_Servicen + GPS.on GPS.Stop not called n.a.
GPS_Servicen + GPS.on GPS_Serviceff called False
GPS_Servicen + GPS.off GPS_Serviceff not called n.a.
where GPS_Service refers to what the user can enable/disable at the OS level, while GPS.on/GPS.off refers to start/stopping GPS reading fixes.
Don't know if it is possible at all (or eventually is already avalable in GPS library 1.20), but maybe two separate events, one for the availability of the service and the other for start/stop reading fixes could make it clearer the GPS usage.
Umberto
I'm experimenting with the GPS library (v. 1.11, maye due to B4A v. 2.71) and came across to what appears a somewhat strange behaviour.
As per Erel definition (see GPS tutorial):
GPS_UserEnabled (Enabled As Boolean)
This event is raised whenever the user changes the status of the GPS device. It is also raised right after calling Start.
Now, what I found so far is that if the user disables the GPS service when we're in a GPS.Stop status then no GPS_UserEnabled event is raised.
I expected that event to be raised with Enabled = False in order to signal the app that GPS service is no more available.
The Enabled = False setting appears as expected when the user disables the GPS service when in the GPS.Start condition.
Summarizing it all in a (kind of) truth table, I have:
Starting condition Action UserEnabled event Enabled var
GPS_Serviceff GPS_Servicen called True
GPS_Servicen + GPS.off GPS.Start called True
GPS_Servicen + GPS.on GPS.Stop not called n.a.
GPS_Servicen + GPS.on GPS_Serviceff called False
GPS_Servicen + GPS.off GPS_Serviceff not called n.a.
where GPS_Service refers to what the user can enable/disable at the OS level, while GPS.on/GPS.off refers to start/stopping GPS reading fixes.
Don't know if it is possible at all (or eventually is already avalable in GPS library 1.20), but maybe two separate events, one for the availability of the service and the other for start/stop reading fixes could make it clearer the GPS usage.
Umberto