Android Question GPS when display turn off

Discussion in 'Android Questions' started by Angelo Pagone, Dec 16, 2016.

  1. Angelo Pagone

    Angelo Pagone Member Licensed User

    I'm trying the GPS demo. When the display turns off the application no longer detects changes of position.
    I need the continuous application running in the background.
    How can I do?

  2. DonManfred

    DonManfred Expert Licensed User

    Start with using the forumsearch. Exact this is answered a lot of times.

    Use a foreground service (for the gps-code) together with a partial wake lock to prevent android from going into sleep
    KMatle likes this.
  3. Angelo Pagone

    Angelo Pagone Member Licensed User

    I'm sorry but I'm a beginner in mobile development.
    For me it is hard to find keywords for forum search.

  4. DonManfred

    DonManfred Expert Licensed User

    I see. Ok ;)

    You now have some keywords to search for ;)
  5. KMatle

    KMatle Expert Licensed User

    Sub Service_Create
        sNotif.Icon = 
    "GPS","Service Running","FromNotification",Main)
        sNotif.Sound = 


    This is how you start the GPS service as a foreground service (a notification is a MUST -> user knows that your app is running)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice