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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:16:28+00:00 2026-05-18T22:16:28+00:00

Greetings, I’m almost finished developing my Android app, however I’d like to be able

  • 0

Greetings,

I’m almost finished developing my Android app, however I’d like to be able to give the user the option to run it minimised in the background and be alerted whenever some event happens.

However, I don’t really know where to start. I’m trying to get an icon to show up on the status bar, to no avail. Essentially I’d like functionality similar to the ‘Trapster’ app where a little icon appears and the app notifies you when you’re approaching a speed camera!

Here’s the code I have sofar:

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

public class Background extends Service{

    @Override
    public IBinder onBind(Intent arg0) {
        // TODO Auto-generated method stub
        return null;
    }
    @Override
    public void onCreate() {
          super.onCreate();
          Toast.makeText(this,"Service created ...", Toast.LENGTH_LONG).show();
    }

    @Override
    public void onDestroy() {
          super.onDestroy();
          Toast.makeText(this, "Service destroyed ...", Toast.LENGTH_LONG).show();
    }
}

Also, is it necessary to set some permission to use a service? Here’s what I have in my manifest file:

<uses-permission
    android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
  • 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-05-18T22:16:29+00:00Added an answer on May 18, 2026 at 10:16 pm

    You’re on a good way, so far. Building what you need requires various steps :

    • Creating a Service, like you began to do. Tha Javadoc for this class explains how a service works a lot better than be, so I’ll let you read it.
    • To display an icon in the status bar, use NotificationManager in your Service.
    • Lastly, the question comes of when to launch your service. You have two possibility :
      • Launching it in your activity, and letting the service work : this is when you have to do a long operation, and want to keep user informed of what happens
      • Launching it periodically, and then letting it come back to sleep : use this method if you only need to check something periodically. For this usage, you can use AlarmManager
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings Friends, I am trying to overlay the simple 2D game I am developing
Greetings all, Is there a built in way to know when a user is
Greetings, By using the regular selector, I am able to select the grand parent
Greetings. I'm just getting started with the boost::asio library and have run into some
Greetings, My app name(the one that appears on the home screen) contains a special
Greetings, I'm uploading an image to my server using the following code: http://cocoadev.com/index.pl?HTTPFileUploadSample However,
Greetings, I've encountered a seemingly bizarre issue, and was wondering if anyone is able
Greetings, I am trying to run an SQL Script uploaded using Application Express (APEX),
Greetings! I've got a Google App Engine Setup where memcached keys are prefixed with
Greetings and salutations, I have two Android apps: one is the server and one

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.