android-music-player

How do I make an intent-filter for playing an MP3 file?

久未见 提交于 2019-11-29 16:22:31
I have created a music player application in Android. Now, when selecting a music file in the phone's file manager, I want my application to appear as one of the options in the "Complete action using" popup. My idea is to do this using intent filter but I have no idea what action, category, or data I need to supply to it. How do I create an intent filter for this? I've also seen a related question here: How do I make an intent-filter for streaming an MP3 file? but mine is not streaming, i am just playing music from file. Thank you in advance. Hope this Intent Filter can help you <intent-filter

How to find a replacement for deprecated method?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 16:15:36
I am new to Android programming. I have been following a tutorial on creating a Music Player from this website The tutorial calls for a setAudioStreamType method from MediaPlayer Class which is deprecated . Which method replaces this deprecated method in particular? And, is there a source where we can find all deprecated methods and its current alternative? Here is the code I have where there is a warning about a deprecated method: public void initMusicPlayer(){ //set player properties player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK); player.setAudioStreamType

Not Getting Thumb with Genres - Universal Music Player

邮差的信 提交于 2019-11-29 13:59:06
I am using UMP example provided by Google, I have not made any change in my code, even I have not tried anything out of the box, I just imported your project into my work-space and checked it on my device, and found that I am not getting Thumb with Genres (Songs by genre) and List of Genres... Whereas I supposed to get Thumb from our JSON, here is what I have tried (but no success) - holder.mImageView.setImageBitmap(description.getIconBitmap()); UPDATE # 1 AS PER SUGGESTED BY @NageshSusarla here holder.mTitleView.setText(description.getTitle()); holder.mDescriptionView.setText(description

Mediaplayer stream online MP3 file

好久不见. 提交于 2019-11-29 06:54:33
I have an Android app that streams an MP3 file and plays this file in player, but the problem is mediaPlayer.prepare(); takes a long time buffering and the app freezes so I tried to use prepareAsync(); , but with this function I can't make the player play the next file. It just plays a single file online; if I need to play another file I have to close and restart the activity when play ends. This is my code: public void playMp3(String _link) { mediaPlayer.setOnPreparedListener(new OnPreparedListener() { public void onPrepared(MediaPlayer mp) { if(!mediaPlayer.isPlaying()){ mediaPlayer.start();

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

╄→гoц情女王★ 提交于 2019-11-29 05:59:14
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) I got this error java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA when tried to call void setDataSource(String path) on an empty file. (0 bytes) You need to be 100% sure that path for the file is not null, not empty, the file itself exists and valid. It was very well buried but I found the source. Here is a link to the error codes It's a build from ICS and

Android SeekBar setProgress is causing my MediaPlayer to skip

风流意气都作罢 提交于 2019-11-29 03:04:42
问题 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 playing seems to cause a slight skip. In the onCreate method I create a Thread with a loop which updates the SeekBar's progress value for the current track. This loop resets when the track is changed. private void createProgressThread() {

How To Add Media To MediaStore on Android 4.4 KitKat SD Card With Metadata

六眼飞鱼酱① 提交于 2019-11-28 22:01:51
Background: In Android 4.4, Google decided that apps should not have write access to SD cards . However, apps can write to /SDCard/Android/data/App Package Name. So this is what I've done. I have written an MP3 file to /Android/data/. I then want this MP3 file to show up in Android music players. I've tried the following... sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + filePath))); and.... MediaScannerConnection.scanFile(this, new String[] { file.toString() }, new String[] {"audio/*"}, new MediaScannerConnection.OnScanCompletedListener() { public void

Android - MediaPlayer Buffer Size in ICS 4.0

早过忘川 提交于 2019-11-28 16:12:08
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 StreamProxy code - http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java My issue is that playback is fast for 2.1 - 2.3, but in Android 4.0 ICS the MediaPlayer buffers too much data before firing the onPrepared listener. An example amount of data written to the Socket OutputStream before onPrepared(): On

How to find a replacement for deprecated method?

丶灬走出姿态 提交于 2019-11-28 09:38:31
问题 I am new to Android programming. I have been following a tutorial on creating a Music Player from this website The tutorial calls for a setAudioStreamType method from MediaPlayer Class which is deprecated . Which method replaces this deprecated method in particular? And, is there a source where we can find all deprecated methods and its current alternative? Here is the code I have where there is a warning about a deprecated method: public void initMusicPlayer(){ //set player properties player

Not Getting Thumb with Genres - Universal Music Player

此生再无相见时 提交于 2019-11-28 07:29:43
问题 I am using UMP example provided by Google, I have not made any change in my code, even I have not tried anything out of the box, I just imported your project into my work-space and checked it on my device, and found that I am not getting Thumb with Genres (Songs by genre) and List of Genres... Whereas I supposed to get Thumb from our JSON, here is what I have tried (but no success) - holder.mImageView.setImageBitmap(description.getIconBitmap()); UPDATE # 1 AS PER SUGGESTED BY @NageshSusarla