Android Question Starter Service Still reliable?

Discussion in 'Android Questions' started by Dianzoa, Aug 28, 2019.

Thread Status:
Not open for further replies.
  1. Dianzoa

    Dianzoa Active Member Licensed User

    Is it still true that starter service ALWAYS run in minimized apps? Android 8 & 9?
     
  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Yes it does always run not unless the OS shuts it down.
    I'm running Android 8, 9 and 10 on devices and as long as you follow Erels basic advice @Dianzoa, in most cases you should not come across any serious issues.
     
    Dianzoa likes this.
  3. Dianzoa

    Dianzoa Active Member Licensed User

    Have You tried to do some repetitive task with a timer in starter? I think it stop functioning after some long time, least than 1 hour or so.
     
  4. Peter Simpson

    Peter Simpson Expert Licensed User

    1. I personally rarely use timers in the starter service (even though that's the best place for them), especially I for that amount of time.
    2. What is it you are trying to accomplish.
    3. If need be you can use partial lock to help you out (search the forum for partial lock).
    4. Respond to question 2.
    5. Search the forum for background location tracker.

    Enjoy...
     
    BillMeyer and Dianzoa like this.
  5. Dianzoa

    Dianzoa Active Member Licensed User

    2 - I try lo get gps location every 3 minutes, it works most of the time if the app is active or recently minimized, it stop working after 1 hour or less sometimes. Until the app is resume, the cycle starts again, but definitely not running "all the time". I am still doing some experiments.
    5 - It has the same problem after awhile.
     
  6. DonManfred

    DonManfred Expert Licensed User

  7. Dianzoa

    Dianzoa Active Member Licensed User

  8. Erel

    Erel Administrator Staff Member Licensed User

    There are no known issues related to the starter service, assuming that you are not doing something wrong. You should provide more information about the issue you encountered.
     
    Dianzoa likes this.
  9. Dianzoa

    Dianzoa Active Member Licensed User

    Is the starter service treated as a foreground or background service ?
    I'm reading this.
    https://developer.android.com/about/versions/oreo/background
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Dianzoa likes this.
  11. Dianzoa

    Dianzoa Active Member Licensed User

    I can say that the timer in starter service in android 9 works as expected. From 10AM to 9PM, the timer triggers the event and do the location update to the DB.
    I will tray on android 8 tomorrow. I will expand the time though from 3 minutes to 15 minutes, to avoid battery issues.
     
    emexes likes this.
  12. Erel

    Erel Administrator Staff Member Licensed User

    The timer will run until the process is killed. The starter service will not prevent the process from being killed.
     
    Dianzoa likes this.
  13. Dianzoa

    Dianzoa Active Member Licensed User

    In Android 8, after a few hours the starter timer no longer works. And the foreground service stops, if I got the app in the foreground from minimized state, it works again, in android 9 the foreground service never stops, works ok at least for 12 hours, not the same case in android 8 :(

    I have to test some other way around to see if it works like android 9
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    You are confusing different things. As I wrote above, the starter service will remain "alive" until the process is killed. It will not prevent the process from being killed.

    If you have a question about background features then you should start a new thread as it is not related to the starter service.
     
  15. Dianzoa

    Dianzoa Active Member Licensed User

    Got it! But if the process is killed, all services are gone? If my phone is android 8 and is connected to debugging, (charging), works ok, in real life, unplugged, stop working in less than an hour, the same code works for at least 12 hours in android 9, there is some big differences?
    In terms of the Starter Service?
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Yes and it has nothing with the starter service.

    It has nothing to do with the starter service.

    This thread is closed as the question in the first post was answered several times. For further discussion start a new thread.
     
Thread Status:
Not open for further replies.
Loading...
  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