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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:14:25+00:00 2026-05-20T14:14:25+00:00

I am an Android newbie and I wanna create a simple mp3 player. Now,

  • 0

I am an Android newbie and I wanna create a simple mp3 player. Now, as far as I understood, good way to do this would be to have a service which would be in charge of MediaPlayer class, and an activity which would represent some sort of UI and also send playing instructions to the service (play, stop, next, etc).

My question is what approach to use for activity-service communication? I tried figuring out these examples, but I don’t see how I can implement pause song, next, previous etc. features of the player.

So I am just interested in concept and maybe some useful links which would guide me a little. Thanks!

  • 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-20T14:14:25+00:00Added an answer on May 20, 2026 at 2:14 pm

    Step #1: Implement a Service.

    Step #2: Have the activity send commands to the service in the form of Intents delivered via startService() (except for “stop”, which would be a call to stopService()).

    Step #3: Have the service handle those commands in onStartCommand() by making appropriate calls on MediaPlayer (be sure to use prepareAsync()).

    Here is a trivial little example of this, for play and stop, with stubbed-out actual media usage. Here is a slightly more sophisticated example of this, using a Notification and startForeground() to ensure the player can keep playing.

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

Sidebar

Related Questions

I am a new newbie to android. Just wanna know how could we create
I am an android newbie so forgive me if this question is simple. Basically
My Google-Fu is failing this Android newbie today. Does anybody know of a good
I am very much an Android newbie and I have built a simple RSS
I am a newbie android developer and so far have only got Hello World
Android newbie here. I'm using this tutorial to show some rows that I fetch
I am newbie to android. I have client server based application. Server keeps on
i'm newbie for android dev, now i want explore file handling in android, for
Im still a newbie in android, would appreciate your help as I couldnt find
I'm a newbie Android developer. I would like to know if there exists a

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.