Location Service is not working on this Device

Discussions about the smartphone versions
Post Reply
tmon
Posts: 10
Joined: Wed Aug 10, 2016 21:26

Location Service is not working on this Device

Post by tmon »

I get the message "Location Service is not working on this Device" whenever I attempt to add the current GPS coordinates to a Dive Site. Location services are definitely enabled, and are working fine with all of my other apps. This is a Samsung S4 with Android 5.01 (Lollipop).

Thanks for any suggestions.
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Location Service is not working on this Device

Post by divinglog »

Hi

In the current version of the app, this message is always displayed when there is any problem with the location service. In the next update I'll output the exact error message, so it will be hopefully more clear what's happening exactly. Please post the error message once I've published the update (should hopefully be out in August).
tmon
Posts: 10
Joined: Wed Aug 10, 2016 21:26

Re: Location Service is not working on this Device

Post by tmon »

In the latest version of the Android app, locating a dive site by GPS works sometimes and not others. As yet, I have been unable to determine why there is this inconsistency.

The error message I am receiving when the Location Service fails is:

Location service is not working on this device.
(NullPointerException)
java.lang.NullPointerException: Attempt to
invoke virtual method 'boolean
android.location.LocationManager.isProvide
rEnabled(java.lang.String)' on a null object
reference.
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Location Service is not working on this Device

Post by divinglog »

Thank you, that helps a little bit. It looks like the setting that returns if the location service is enabled for Diving Log, returns just NULL instead of TRUE or FALSE. I will treat a NULL as True and hopefull it will work then more consistent. If you want I can provide you the APK package to try it before I'll publish the next update.
tmon
Posts: 10
Joined: Wed Aug 10, 2016 21:26

Re: Location Service is not working on this Device

Post by tmon »

There is no urgency right now as I don't have any dives planned for a couple of months, but I'm happy to test the new APK if that would be helpful to you. The only problem is that I don't always get the error, and don't know any specific steps that allow me to reproduce it reliably.
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Location Service is not working on this Device

Post by divinglog »

I've sent you the link to the APK via PM. Please let me know if you still have sometimes these GPS problems.
tmon
Posts: 10
Joined: Wed Aug 10, 2016 21:26

Re: Location Service is not working on this Device

Post by tmon »

I've now gone back and forth between the 1.6 release and the APK you provided me for evaluation. With respect to both versions, I would like to note that the Location Service works far more often than it fails. In fact, I would guess the success rate is over 90%. So this is not as big an issue for me as it appeared to be in the previous release.

With that said, on the rare occasion when the Location Service fails on the unreleased version, the error message is different than it was previously. It now reads:

Location Service is not working on this device.
(NullPointerException)
java.lang.NullPointerException: Attempt to invoke
virtual method 'void android.location.LocationManager.requestLocationUpdates
(java.lang.String, long, float, android.location.LocationListener)'
on a null object reference.

My initial thought is that whatever change you made simply pushed the error further along the process with no real benefit. And again, since I seem to be the only one complaining about this, it may not be worth investing a lot of time unless and until someone can reproduce it reliably.

On another unrelated note, I am occasionally seeing the following error message in both versions of the app. It appears to occur when I return to the app after having left it while editing a dive site. For example, I'm editing a dive site, switch to gmail to respond to an incoming message, then some time later reopen the dive log app. Occasionally when I reopen the app the following error message appears.

Error occurred

An error has occurred in sub:frmdetailslist-vvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvv2 (java line:
754)
java.Iang.NullPointerException:
Attempt to invoke virtual method
'java.Iang.0bject
anywheresoftware.b4a.objects.colle
ctions.Map. Get(java.Iang.Object)'
on a null object reference
Continue?

No Yes

Finally, a couple of thoughts:

1. It would be nice if, at least as an option, Dive Sites could be subsets of Countries and City/Islands. I have a lot of countries in my log, and many duplicate site names. For example, I have at least three or four sites named "Lighthouse Reef". It would be helpful if when I selected a country and then a city/island, the list of selectable Dive Sites was limited to those from the selected area(s). Scrolling through dozens if not hundreds of Dive Sites to find the right one doesn't seem ideal.

2. When adding a new Dive at new Dive Site, I can add a new Dive Site name, but cannot edit or enter the details at the same time. I enter the name, select the site, then have to finish adding the dive before going back to the logbook, choosing dive sites, and editing the new dive site from there. I would like to have the ability to edit the Dive Site details as I am entering the dive and adding the dive site, much as I can in the desktop version.

I apologize if either of these ideas have been previously considered or discussed or even dismissed here. There's certainly nothing here I can't live without. Overall, I'm very happy with the desktop and android versions of the software and will certainly recommend both to others.

Thanks
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Location Service is not working on this Device

Post by divinglog »

Hi

Sorry for the late response and thank you for your extensive testing! In the past the check for GPS functionality failed with the error. I've now made this check optional and try to access the GPS anyways. So if there is a problem, the error occurs a bit later in the code, but still happens.
tmon wrote:1. It would be nice if, at least as an option, Dive Sites could be subsets of Countries and City/Islands.
Yes, this is something that is also requested for the desktop version from time to time. I still try to find a good solution for this.
tmon wrote:2. When adding a new Dive at new Dive Site, I can add a new Dive Site name, but cannot edit or enter the details at the same time.
Thank you, I think it's a good idea to allow completing the dive site details before returning to the dive. I'll see if it can be implemented without disrupting the workflow.
Post Reply