I tried different phone position, turned off all energy saving options, double check that precise location is allowed for app, but without any difference. Other apps like google fit have no issues with GPS.
All settings for GPS are default and I do collect data from it with a simple store to dictionary blocks…
On Android 12 (API level 31) or higher, users can request that your app retrieve only approximate location information, even when your app requests the ACCESS_FINE_LOCATION runtime permission.
To handle this potential user behavior, don’t request the ACCESS_FINE_LOCATION permission by itself. Instead, request both the ACCESS_FINE_LOCATION permission and the ACCESS_COARSE_LOCATION permission in a single runtime request. If you try to request only ACCESS_FINE_LOCATION , the system ignores the request on some releases of Android 12. If your app targets Android 12 or higher, the system logs the following error message in Logcat:
ACCESS_FINE_LOCATION must be requested with ACCESS_COARSE_LOCATION.
it looks like our @Kodular team will have to provide a solution, so both permissions can be requested in a single runtime event… alernatively someone could write a short extension for that…
On a screensot fine location is on. Same as on other apps where fine location works as it should.
Thank you for dig out the problem Kodular team needs to solve tat isusse as soon as possible as waiting for someone to write extension is no solution at all. I know your work, bought some extensions from you so perhaps you could write that short extension… would be pretty much like kodular solution
Thanks for link. As I do understand, there will be some solution later this month. I also tried what was suggested in above that MIT response and set up privilledge outside the screen init and that seems to solve a part of the problem as location is now fine. BUT… yeah there is always a BUT
It is updated ike every minute or even less instead of every s…I tested with default 1000ms and some values up and down… nothing helped.
I also turned of all battery saving options… Hope till end of august all that will dissapear… or I will need to swithc to older phone for that purpose
as you can see, location was was updating like every 3…5s in one direction but then it stops on the way back. I can’t see any reason for that as you can see app logs constantly without any problems… But it is interesting that previuse drive actualy produced same patern… At the begining it does update but then stops…
If you have any more suggestion I will try tomorrow
how do you keep your app up and running while doing this drive?
as you probably know, I developed a locationservice extension, which is able to run in the background while your app is closed…
also the extension offers 2 methods to ask for the location permissions,
RequestLocationPermission, which requests the basic location permissions (coarse and fine)
Note : Starting with Android 12 asking the user to grant location permission got again more complicated, see also this stackoverflow answer. The extension therefore offers 2 methods to ask for the required permissions.
App is always on main screen. I had idea to redo it with background tasks but I am a little to lazy for doing that I am familliar with your extension. As I said I bought a few from you already in the past
Usually the device gioes to sleep if you do not use it… so usually the location sensor does not work anymore afrer a while if you do not use a nethod to keep the screen on… however doing this obviously drains the battery faster…
Yrs, to use the location sensor in the background and store the data in TinyDB
App do much more then just collect data from GPS. It does connect to a car via BT OBD and it constantly polls data from the engine. Then it does the neccesery calculations to extract everything and sends that to remote database with an api call to backend server. Also it shows some data on screen in real time and provide deep register anlaitics (down to bit ) so I can discover other data that I know are present in those registers.
So it never goes to sleep as it always show something on screen (usualy speed, RPM, temperature, saturation and back preassure of the FAP filter, its regeneration status, kilometers from the last regeneration and some other stuff I like to see )
Very basic visualisation to keep data refresh speed as hi as possible. Because of really a lot of data (from 22.1.2021 till today there is 7.312.774 records in the database, 22 minutes today gave almost 13.000 new records - around 10 per second of driving) I use dictionary for temp storage to avoid constant writing to SD card. Thats why I changed from sqlite to dictionary and also gained some speed that way.
So I don’t think it is a background issue but I am willing to try if you provide me an extension to try. If it solve the issue I am sure ready to pay you asked price.
yes and I did and it does run forever and with android <12 everything worked like a charm… now GPS really suks…I tried what ever fall to my mind and nothig helped… I put both permissions request in app itself (coarse and fine location) and nothign … Need to see how to make extension that would follow requests for permisions…
exactly. I need to rewrite whole code if I want to use background services. but at the moment I do not really know how all togehter work as I never look into it
As you suggested, my intention was to leave it as is and learn how to make that short extension for permissions but… From I do not know the reason today on the way to office, it worked as it should. I will see what will be on next drive…