I am writing an app that has to read the GPS even in background.
I managed to maintain the app working in background (what in itself is an issue in ai2), thanks to Ullis Roboter's wonderful tools:
I am sure the app is running in bg as, for example, it produces sounds from time to time, items are updated, etc.
But... the GPS feature stops working after some time in bg. I mean, everything in the app goes on working but the "ChangeLocation" event of the location sensor is not fired, so that the coordinates read by the app are "frozen". Until the app goes to foreground again... then GPS starts again.
I turned OFF "battery optimization" for the app in Android's setting but it didn't solve the problem.
Many thanks in advance!