3
anon81
7y

Any iOS or Android devs here?

I have a question, that I hope you will answer:

It is possible for an app to log the users location, say every half hour, while the app is running in the background AND the screen of the device is locked?

Comments
  • 1
    Yeah i guess
    Not an android/iOS developer but
    It might be
  • 1
    Yes it is, just relaunch the app on memory clean
  • 3
    Yes... on both.
    With iOS make sure your app declares itself as using location in the background.
    Then, the location update method in the app will still perform. Don't abuse it with a call to an API every time... you will get rejected. I don't remember the specifics, but it is to execute within a very small amount of time.
  • 1
    Thanks guys!
  • -1
    When did devRant turned into stackoverflow.com?

    And the answer is of course yes in both of them. How could RunKeeper or runtstic log your run if not?
  • 1
    It may come as a surprise to you, but I do not use those apps, so I can't tell you how or if they work when the screen is locked. A quick search on Google reveals a few problems with GPS and locked device screens though.

    Sorry for asking my question here, but unlike Stackoverflow I got a quick, short and precise answer answer without taking a major detour through every theoretical approach to the problem possible. I'll investigate this later...

    And that's exactly what I needed to move on with this wild business idea that suddenly popped up...

    Have a great weekend!
  • 1
    @lewdogg yes. I will add that in mobile devices it is always better to batch API calls (if network access is involved)
  • 0
    @anon81 just imagine someone running while having to keep the screen unlocked.

    Good to know you got your answer quickly.

    I have been out from devRant for some weeks and now that I am using it again, I can see many people asking questions. You are not the only one. Excuse me if that annoyed you. It wasnt intentional.
  • 1
    @kekkyojin no hard feelings at all! Maybe questions could be tagged "QandA" and then only shown by searching for that tag?

    @dfox
  • 0
    Uhh.... Google always knows where you are and where you've been?

    https://google.com/maps/timeline/
Add Comment