Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:37:11+00:00 2026-06-06T05:37:11+00:00

I need to have ALWAYS a background service that will synchronize my Android application

  • 0

I need to have ALWAYS a background service that will synchronize my Android application and a server. I know how to launch it through my application, but when the Android turns off, then the background service will die.

How can I do to keep the background service always running? (Even when the device turns off and then turns on…)

I need to add to the starts programs of Android my background service. Any hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:37:13+00:00Added an answer on June 6, 2026 at 5:37 am

    use <action android:name="android.intent.action.BOOT_COMPLETED" /> for starting your service when the device turns on.

    In AndroidManifest.xml:

     <receiver android:name=".BootBroadcastReceiver" >   
                <intent-filter>   
                    <action android:name="android.intent.action.BOOT_COMPLETED" />   
                </intent-filter>   
            </receiver> 
    

    Add permission in your AndroidManifest.xml as:

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED">
    </uses-permission>
    

    In code part BootBroadcastReceiver:

    public class BootBroadcastReceiver extends BroadcastReceiver {     
        static final String ACTION = "android.intent.action.BOOT_COMPLETED";   
        @Override   
        public void onReceive(Context context, Intent intent) {   
            // BOOT_COMPLETED” start Service    
            if (intent.getAction().equals(ACTION)) {   
                //Service    
                Intent serviceIntent = new Intent(context, StartOnBootService.class);       
                context.startService(serviceIntent);   
            }   
        }    
    }   
    

    EDIT: if you are talking about device screen on/off then you need to register <action android:name="android.intent.action.USER_PRESENT" /> and <action android:name="android.intent.action.SCREEN_ON" /> for starting your service when user is present or screen is on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning Objective-C, and have a C/C++ background. In object-oriented C++, you always need
I have a custom button named ‘rename’. I need the button will always disabled.
I have a navigation bar and I need to always keep the current one
I have a little business and I always need to share files with my
I have one dictionary I need to save into a plist. The paletteDictionary always
I have need for a function pointer that takes two arguments and returns a
i have an application that records a date/time when the space bar is pressed
Background: I have a function in my program that takes a set of points
I'm working on a Wake on LAN service that will run from a web
Background: I have a project that is not at all large scale (2 ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.