Questions tagged [android-music-player]

598 questions
84
votes
9 answers

READ_EXTERNAL_STORAGE permission for Android

I'm trying to access media files (music) on the users device to play them; an easy "hello world"-music player app. I've followed some tutorials and they basically give the same code. But it won't work; it keeps crashing and telling…
42
votes
2 answers

Android - MediaPlayer Buffer Size in ICS 4.0

I'm using a socket as a proxy to the MediaPlayer so I can download and decrypt mp3 audio before writing it to the socket. This is similar to the example shown in the NPR news app however I'm using this for all Android version 2.1 - 4 atm. NPR…
denizmveli
  • 2,528
  • 1
  • 20
  • 18
34
votes
7 answers

Android background music service

I am developing an entertainment app in android. I want to play background music, and I want to use service for that. App have 3 activities and music must be played across all activities. Also, when activity is paused, music must PAUSE and stopped…
Rohit
  • 2,410
  • 6
  • 26
  • 40
33
votes
1 answer

How to turn the volume to max programmatically on android?

I am writing an app for android that turns up the volume and plays a song for 45 seconds and then stops. That works great, however I can only get the volume to turn up to 50%, Is there a way to turn the volume up to 100% using setVolume()? This is…
Sarah
  • 2,413
  • 12
  • 29
  • 42
27
votes
4 answers

How to put media controller button on notification bar?

I am creating a music player application. I want to show the media controller on notification bar while my application is running in background. It looks like Google player. How to do this?
Leap Bun
  • 2,126
  • 3
  • 25
  • 43
21
votes
5 answers

Media Player controls in Notification

I have written complete Music Player to stream music from the web, but I don't know how to put media player controls in Notification and when the screen is Lock. I am following this tutorial to show controls in the Notification bar, but still not…
Sophie
  • 2,384
  • 10
  • 39
  • 71
18
votes
2 answers

How to stop other apps playing music from my current activity?

In my app I am trying to make a button which when clicked stops all other apps that are playing music. What I want is similar to that if I am playing music through one music player and if I try playing some other music through a second music…
Ujjwal Syal
  • 367
  • 1
  • 3
  • 12
17
votes
3 answers

Trouble playing a song in Google Music player

Is there any way to start playing a song in Google music player app from my app? I am trying following code, but google music player only opens the search results & does not actually play the song. Intent intent = new Intent(); …
user1309043
  • 181
  • 3
16
votes
6 answers

How do I access the MediaMetadataRetriever.setDataSource(...) status codes?

I'm getting the following error java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA and I'd like to know what this status is. I'm using the function MediaMetaDataRetriever.setDataSource(String filePath)
Andrew Orobator
  • 6,377
  • 3
  • 28
  • 35
15
votes
1 answer

Android SeekBar setProgress is causing my MediaPlayer to skip

I'm trying to use a SeekBar to display both the length of a track played by a MediaPlayer class and to enable seeking within the track. Seeking within the track works well. However, updating the progress value using setProgress while the track is…
13
votes
1 answer

How do you check if music is playing by using a broadcast receiver?

I would like to prevent some of my code from executing only when music or videos are currently playing. How would I accomplish this using a broadcast receiver?
13
votes
6 answers

Android application to Pause/Resume the music of another music player app

In my Android application, I am playing different mp3 files using the MediaPlayer class. The user is playing his/her own music with the default music application. I want to: Pause the music of the default music application. Start playing music…
12
votes
2 answers

Android Exerciser Monkey starts playing audio files at random

I'm running exerciser monkey to test my android app. As part of my app I play media files which give the pronunciation of a words. I've put the files in a directory where they aren't readable by the Android's Music player. However, the exerciser…
12
votes
2 answers

How to play or resume music of another music player from my code

In my Android app I want to play or resume the played music after I pause it. I got my app to pause the music by sending a broadcast, but I can't get it to play or resume the music. Here is the code to pause: Intent i = new…
iboalali
  • 339
  • 1
  • 4
  • 11
11
votes
2 answers

How to get read external storage permissions?

I'm developing an mp3 player application for android and I'm getting an error related to user permissions(READ_EXTERNAL_STORAGE) This is my code where I ask for permissions: int permissionCheck =…
1
2 3
39 40