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. Service or Daemon for getting location of my device?
Qt 6.11 is out! See what's new in the release blog

Service or Daemon for getting location of my device?

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 2.6k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    smita30apr
    wrote on last edited by
    #1

    Hi,

    I am trying to write an application which tells the GPS location of the device. What I want is: once I install my application, the device should send the location to a server at a specific time interval even when the application is NOT running. How do I achieve it?

    Should I use a service or write a daemon for this small task? Also if there is any example of such kind of requirement?

    Regards

    1 Reply Last reply
    0
    • A Offline
      A Offline
      amccarthy
      wrote on last edited by
      #2

      You don't mention what type of device and what version of Qt you are using.

      Write a console application that gets the GPS location of the device, you can use Qt Location for this, and send the location to the server. Either have the application run continuously or arrange for it to be started periodically (e.g. using by using cron).

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Your basic question is just impossible: you cannot make a random OS send the devices location to a server without having your application running. You either have code running (a service, a deamon, something started periodically, whatever) that sends the location, or you don't have code running and nothing is send. That might mean you will need to split off that functionality into its own, and let the user-visible part of your application just connect to this split off part when needed.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          smita30apr
          wrote on last edited by
          #4

          Hi,

          Thanks for your reply. Yes I know the OS cant send the signals, thats why I asked whether I should make a daemon or service. So my requirement is like this:

          1. User installs the application
          2. User closes the application.

          Now still the application/daemon/service can send the server its device co-ordinates.

          I fetched my location using QLocation. Just I want to send it to the server, even when the application is not running. So what more should I do? Shall I create a daemon/service?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            amccarthy
            wrote on last edited by
            #5

            And both responses said, yes you do need to write a daemon or service.

            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