Android Oreo background service is not working in doze mode?












1














I am using background service to get user location and upload to server.



I have used one LocationTrack class which is extending Service class and AlramReciver which is extending BroadcastReciver.



I have added all permission in manifest and register AlarmReciver and LocationTracker class in manifest file.



But when app goes into DOZE mode then service is not working.



I have tried following links but its not working anyways.




  1. How to create background services for android Oreo without notifications like social networking applications Facebook, Messenger, Zalo

  2. Background service for android oreo


  3. Android Oreo killing background services and clears pending alarms, scheduled jobs after entering doze mode


  4. Oreo - Starting a service in the foreground


  5. https://developer.android.com/training/monitoring-device-state/doze-standby


  6. https://android.jlelse.eu/keep-those-background-services-working-when-targeting-android-oreo-sdk-26-cbf6cc2bdb7f



7.https://developer.zebra.com/community/home/blog/2018/10/26/keeping-your-application-running-when-the-device-wants-to-sleep



I have tried Jobdispatcher also but nothing works out.



Possibly it seems duplicate question but i don't understands whats wrong with my Code.
Please help to get rid of this.
Thanks in advance.










share|improve this question





























    1














    I am using background service to get user location and upload to server.



    I have used one LocationTrack class which is extending Service class and AlramReciver which is extending BroadcastReciver.



    I have added all permission in manifest and register AlarmReciver and LocationTracker class in manifest file.



    But when app goes into DOZE mode then service is not working.



    I have tried following links but its not working anyways.




    1. How to create background services for android Oreo without notifications like social networking applications Facebook, Messenger, Zalo

    2. Background service for android oreo


    3. Android Oreo killing background services and clears pending alarms, scheduled jobs after entering doze mode


    4. Oreo - Starting a service in the foreground


    5. https://developer.android.com/training/monitoring-device-state/doze-standby


    6. https://android.jlelse.eu/keep-those-background-services-working-when-targeting-android-oreo-sdk-26-cbf6cc2bdb7f



    7.https://developer.zebra.com/community/home/blog/2018/10/26/keeping-your-application-running-when-the-device-wants-to-sleep



    I have tried Jobdispatcher also but nothing works out.



    Possibly it seems duplicate question but i don't understands whats wrong with my Code.
    Please help to get rid of this.
    Thanks in advance.










    share|improve this question



























      1












      1








      1







      I am using background service to get user location and upload to server.



      I have used one LocationTrack class which is extending Service class and AlramReciver which is extending BroadcastReciver.



      I have added all permission in manifest and register AlarmReciver and LocationTracker class in manifest file.



      But when app goes into DOZE mode then service is not working.



      I have tried following links but its not working anyways.




      1. How to create background services for android Oreo without notifications like social networking applications Facebook, Messenger, Zalo

      2. Background service for android oreo


      3. Android Oreo killing background services and clears pending alarms, scheduled jobs after entering doze mode


      4. Oreo - Starting a service in the foreground


      5. https://developer.android.com/training/monitoring-device-state/doze-standby


      6. https://android.jlelse.eu/keep-those-background-services-working-when-targeting-android-oreo-sdk-26-cbf6cc2bdb7f



      7.https://developer.zebra.com/community/home/blog/2018/10/26/keeping-your-application-running-when-the-device-wants-to-sleep



      I have tried Jobdispatcher also but nothing works out.



      Possibly it seems duplicate question but i don't understands whats wrong with my Code.
      Please help to get rid of this.
      Thanks in advance.










      share|improve this question















      I am using background service to get user location and upload to server.



      I have used one LocationTrack class which is extending Service class and AlramReciver which is extending BroadcastReciver.



      I have added all permission in manifest and register AlarmReciver and LocationTracker class in manifest file.



      But when app goes into DOZE mode then service is not working.



      I have tried following links but its not working anyways.




      1. How to create background services for android Oreo without notifications like social networking applications Facebook, Messenger, Zalo

      2. Background service for android oreo


      3. Android Oreo killing background services and clears pending alarms, scheduled jobs after entering doze mode


      4. Oreo - Starting a service in the foreground


      5. https://developer.android.com/training/monitoring-device-state/doze-standby


      6. https://android.jlelse.eu/keep-those-background-services-working-when-targeting-android-oreo-sdk-26-cbf6cc2bdb7f



      7.https://developer.zebra.com/community/home/blog/2018/10/26/keeping-your-application-running-when-the-device-wants-to-sleep



      I have tried Jobdispatcher also but nothing works out.



      Possibly it seems duplicate question but i don't understands whats wrong with my Code.
      Please help to get rid of this.
      Thanks in advance.







      android service android-8.0-oreo android-intentservice firebase-job-dispatcher






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 at 6:38









      Aniruddh Parihar

      2,15911027




      2,15911027










      asked Nov 23 at 6:36









      vivek pagar

      117




      117
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.



          Check this answer with firebase job dispatcher






          share|improve this answer





















          • Thanks @Amit Jandi for quick response. will follow this link and get back to you
            – vivek pagar
            Nov 23 at 6:43












          • I have already gone through this link.
            – vivek pagar
            Nov 23 at 6:47










          • so is it working or not...i'm using in my apps and it works perfectly..
            – Amit Jangid
            Nov 23 at 7:04










          • nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
            – vivek pagar
            Nov 23 at 7:10











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441678%2fandroid-oreo-background-service-is-not-working-in-doze-mode%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.



          Check this answer with firebase job dispatcher






          share|improve this answer





















          • Thanks @Amit Jandi for quick response. will follow this link and get back to you
            – vivek pagar
            Nov 23 at 6:43












          • I have already gone through this link.
            – vivek pagar
            Nov 23 at 6:47










          • so is it working or not...i'm using in my apps and it works perfectly..
            – Amit Jangid
            Nov 23 at 7:04










          • nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
            – vivek pagar
            Nov 23 at 7:10
















          0














          You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.



          Check this answer with firebase job dispatcher






          share|improve this answer





















          • Thanks @Amit Jandi for quick response. will follow this link and get back to you
            – vivek pagar
            Nov 23 at 6:43












          • I have already gone through this link.
            – vivek pagar
            Nov 23 at 6:47










          • so is it working or not...i'm using in my apps and it works perfectly..
            – Amit Jangid
            Nov 23 at 7:04










          • nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
            – vivek pagar
            Nov 23 at 7:10














          0












          0








          0






          You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.



          Check this answer with firebase job dispatcher






          share|improve this answer












          You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.



          Check this answer with firebase job dispatcher







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 at 6:42









          Amit Jangid

          9181716




          9181716












          • Thanks @Amit Jandi for quick response. will follow this link and get back to you
            – vivek pagar
            Nov 23 at 6:43












          • I have already gone through this link.
            – vivek pagar
            Nov 23 at 6:47










          • so is it working or not...i'm using in my apps and it works perfectly..
            – Amit Jangid
            Nov 23 at 7:04










          • nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
            – vivek pagar
            Nov 23 at 7:10


















          • Thanks @Amit Jandi for quick response. will follow this link and get back to you
            – vivek pagar
            Nov 23 at 6:43












          • I have already gone through this link.
            – vivek pagar
            Nov 23 at 6:47










          • so is it working or not...i'm using in my apps and it works perfectly..
            – Amit Jangid
            Nov 23 at 7:04










          • nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
            – vivek pagar
            Nov 23 at 7:10
















          Thanks @Amit Jandi for quick response. will follow this link and get back to you
          – vivek pagar
          Nov 23 at 6:43






          Thanks @Amit Jandi for quick response. will follow this link and get back to you
          – vivek pagar
          Nov 23 at 6:43














          I have already gone through this link.
          – vivek pagar
          Nov 23 at 6:47




          I have already gone through this link.
          – vivek pagar
          Nov 23 at 6:47












          so is it working or not...i'm using in my apps and it works perfectly..
          – Amit Jangid
          Nov 23 at 7:04




          so is it working or not...i'm using in my apps and it works perfectly..
          – Amit Jangid
          Nov 23 at 7:04












          nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
          – vivek pagar
          Nov 23 at 7:10




          nope. it's not working in doze mode. Do i need to add android:enable="true" property in manifest for Class which extend JobServices class
          – vivek pagar
          Nov 23 at 7:10


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441678%2fandroid-oreo-background-service-is-not-working-in-doze-mode%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)