Questions tagged [android-music-player]

623 questions
2
votes
0 answers

Use .setDataSource to get mediaMetadata from currently playing music app

I want to get MediaMetadata (song title / artist) from the current playing android audio source for any app (spotify, google play, soundcloud, YouTube, blackplayer, etc) and am trying to use MediaMetadataRetriever.setDatSource Currently I have a…
2
votes
0 answers

How to use sliding up panel with bottom navigation view?

I am using this library for sliding up panel. I'm trying to use it with the bottom navigation view, for my music streaming app. I am trying to do something like soundcloud app. But I'm unable to achieve this and it shows like this I have two player…
2
votes
1 answer

Notification cannot be cleared after setOngoing(false)

I have a music player which shows a media notification while audio is playing. I want the user to be able to dismiss the notification when music is paused. I have to use startForeground so that the service will continue running AND it will stay…
2
votes
3 answers

Check if album art exists?

I'm building a music player app. I'm trying to populate a recyclerView with album arts of songs. I successfully did that with the code that is given below. But some of the songs do not have embedded album art not any album art in the folder. So, I'm…
2
votes
0 answers

Get currently active AudioSessions or AudioOutput

I'm trying to create a Visualizer with the Visualizer Class. The documentation says to use "0" as session id to get the audio output, however this seems to be deprecated and only results in an error. I searched for ways to get the currently active…
2
votes
1 answer

Caused by: java.lang.RuntimeException: Cannot initialize effect engine for type: 0bed4300-ddd6-11db-8f34-0002a5d5c51b Error: -3

I am testing equalizer in my Android Version 7.1.1 but it shows a Runtime Exception but It's perfectly working on below version 7.0. When I try to initialize equalizer : private static UUID EQUALIZER_UUID; mp = MediaPlayer.create(this,…
Rohit Gurjar
  • 437
  • 4
  • 12
2
votes
0 answers

Reordering of recyclerview items by drag and drop in playlist

I'm working on a music player for android. I introduced the playlist feature in which users can create playlist and add songs to playlist. So, in the playlist, I have implemented the drag and drop feature (moving song from one position to other by…
2
votes
1 answer

Adding tracks to playlist

I'm working on playlist in my audio player. I have return a code to add songs to playlist. The code works fine, but i have a small problem though. The problem is if I add a single song to playlist, two copies of the same song are added. It is like,…
Rektirino
  • 582
  • 5
  • 24
2
votes
3 answers

Insert data into table and if already present bring it to the top SQLite

I'm making a "Recently played" playlist in my music app. I have created a database for storing the info related to songs. What my current code does is whenever I play a song it add it the database and I can successfully display it. But the problem…
Rektirino
  • 582
  • 5
  • 24
2
votes
1 answer

How to get list of all music files from android phone

I created an app that scans music files on the mobile phone. It scans the music files if I scan the folder /sdcard/Music but it doesn't scan the mp3 file when I write /sdcard. It is working fine. But it is not working on some devices, the…
2
votes
1 answer

How to use single instance of MediaPlayer across all activities and fragments?

I have several activities and fragments that displays songs from SD card and when I click on any of them, it plays. The problem is I have to create a new instance of media player in each of these activities and fragments. So, if I play a song in one…
2
votes
3 answers

Marquee is not working when seek bar gets updated

I'm making a music player and have implemented a marquee for the song and artist name. But as soon as the seek bar gets updated, the text view comes back to the original position. So in this way, a kind of back and forth motion of text is seen. Here…
2
votes
2 answers

Detecting if user is playing music from another app

My game has an in-game soundtrack and I would like to pause the music if the user is playing music of their own from a media app on Android or iOS. Is there a way to do this that is efficient enough to run in an update() function? Thanks in advance!
Tiaan
  • 698
  • 2
  • 10
  • 32
2
votes
1 answer

Abandoning audio focus does not resume music streaming for other apps

I'm working on an app allowing users to watch videos. When they open a video to watch, I call: AudioManager mAudioManager = (AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE); mAudioManager.requestAudioFocus(this,…
user4224535
2
votes
0 answers

Album art missing from MediaStore

I have a simple music player app that I created. So far it's been obtaining song metadata from android.provider.MediaStore. I obtain album art from the ALBUM_ART column of MediaStore.Albums. It returns a path to the album cover and I create a…