We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone, i have an app that uses ketai gps, and it was working all fine and now it doesn't, the coordinates that throws are 0, 0, 0, it's like i have no signal, but when i switch to google maps i have the location, no changes where made to the code, could this be because an android update? if this is the case, what should i do?
Answers
There are few things that could have been updated.
Processing
Android Mode in Processing
Ketai also was updated to reflect the latest Android mode version. I am not sure if the updated Ketai is compatible with an older Android Mode version. To Clarify, there is a core difference in the Android mode and you need to be aware if you are working with AM version 3.xxx or 4.xxx
To capture this problem properly, could you tell what changed in your setup? Did you updated your Android mode? Your ketai? Or are you using a different mode?
I don't have much experience but maybe you need to manage your permissions. If you google "Android developers manage permissions" you should get some instructions of how permissions should be managed. You can add that code in Processing.
There will be some troubleshooting you need to do on your side as your problem won't be easy to reproduce. If you document changes in your systems (version changes) would be a good start. If you load your code in a repo in github, I could trying running it this weekend.
Kf
my settings are:
AM is 4.0.1 ketay is v14 android version is 7.0
the only change that i can remember is updating the andorid from my phone, the permissions remain the same (since i didn't change the app), trying out the ketay examples, the same happens (latitude and longitude remains on 0), i could try to verify if the program works on the same phone but with the original android version.
thanks.
@erwrow===
i dont know what is happening for your app; what i know is that there are a lot of cases in which for various reasons ketai does not work. So, as ketai is only a wrapper for android, i think that it is more sure to use android API.
As for location there are many ways to do that; you can use googlePlayservice or code yourself : firstly you create an instance of LocationManager which is a system service; after that you create a Location object with your LocationManager and now you can get your location (double latitude, double longitude): snippet here::
In order to be more efficient you can add a listener to your locationManager, implementing the required methods and commenting the 2 lines where it is called for latitude && longitude.
//Called when the provider is enabled by the user. }
//could be OUT_OF_SERVICE, AVAILABLE, TEMPORARLY_UNAVAILABLE //alert the user } };
i have used this code or rather this kind of code for a lot of times and i am sure that it works; of course you must have the (3) permissions granted (and test that at runtime); of course also before instantiating the LocationManager you have to test the network (is wifi or mobile available...) and choose the provider.