Important: Please read the Qt Code of Conduct -

GPS Position in an Android Service

  • Hi,

    i have have written an Android Application with the latest Qt version which monitors the current position of the device and updates the current position in case of any changes. I would like to move the position update part into a service to ensure that the position is also updated when the application is not running actively. I am able to start a android service and i can see in the debug console that its working fine. But when i use QGeoPositionSourceInfo to get the current position, the Service crashes when i call updatePosition. I have read that there are problems with this class when used in a Android Service ( . Therefore i would like to know if anybody has a running setup for such a use case with QGeoPositionInfo or can tell me an altervative approach. When reading about Android Services in the Qt documentation, logging GPS position is the very first use case that is mentioned therefore i hope that anybody has a solution for this problem.

  • Here is an example of Qt app for Android with similar service:

  • Hi,

    thanks a lot. That looks exactly for what i m searching. I will give it a try.

Log in to reply