Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. GPS Position in an Android Service
Forum Update on Monday, May 27th 2025

GPS Position in an Android Service

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 363 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreas K.
    wrote on last edited by
    #1

    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 (https://bugreports.qt.io/browse/QTBUG-71396) . 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.

    K 1 Reply Last reply
    0
    • A Andreas K.

      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 (https://bugreports.qt.io/browse/QTBUG-71396) . 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.

      K Offline
      K Offline
      KoneTaH
      wrote on last edited by
      #2

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

      https://github.com/vkgeo/vkgeo-android

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Andreas K.
        wrote on last edited by
        #3

        Hi,

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved