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 9025871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:22:58+00:00 2026-06-16T06:22:58+00:00

I am working on an Application that requires to start a BackgroundService on Android

  • 0

I am working on an Application that requires to start a BackgroundService on Android Boot

This is the code that I am using to start the BroadcastReceiver on Android Boot

public class StartOnBootService extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        try
        {
        if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
            Intent serviceIntent = new Intent();
            serviceIntent.setAction("com.package.myApplicationPackage.BackgroundService");
            context.startService(serviceIntent);
        }
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}

This is my BackgroundService.class

public class BackgroundService extends Service {

   @Override
   public IBinder onBind(Intent intent) {
      return null;
   }

   @Override
   public void onCreate() {
      //code to execute when the service is first created
       Toast.makeText(getBaseContext(), "BACKGROUND SERVICE STARTED", Toast.LENGTH_LONG).show();
   }

   @Override
   public void onDestroy() {
      //code to execute when the service is shutting down
   }

   @Override
   public void onStart(Intent intent, int startid) {
      //code to execute when the service is starting up
   }
}

This is the error log that I managed to snipe from the CatLog while my Android was Booting.

12-21 10:28:01.279: E/EmbeddedLogger(1710): App crashed! Process: com.package.myApplicationPackage
12-21 10:28:01.289: E/EmbeddedLogger(1710): App crashed! Package: com.package.myApplicationPackage v1 (1.0)
12-21 10:28:01.289: E/EmbeddedLogger(1710): Application Label: myApp Label

My AndroidManifest.xml file

        </service>
        <service android:name=".BackgroundService">

            <intent-filter>
                <action android:name="com.package.myApplicationPackage.BackgroundService" />
            </intent-filter>
        </service>
        <receiver
            android:name=".receiver.StartOnBootService"
            android:enabled="true"
            android:exported="true"
            android:label="StartOnBootService">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
  • 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-16T06:22:59+00:00Added an answer on June 16, 2026 at 6:22 am

    You Broadcast receiver name and android manifest receiver name is totally differ.

    StartOnBootService or in manifest it is StartMyServiceAtBootReceiver

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

Sidebar

Related Questions

Am currently working on an application that requires users to submit posts and comments
I am working on an application that requires text larger than the viewable screen
I'm working on an application that requires support for forward locking of media files
I'm working on an application that requires a server to do most of the
I am currently working on a GWT application that requires report printing. The use
i am working on a web application that now requires a CMS. Could you
I'm currently working a problem that requires my web application to generate a chart
I'm working on a project that requires a Web-based workflow application. We're now evaluating
The iPad application I'm working on requires that the user provide a username and
I am working on a php application which requires that I extract the dates

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.