How to implement an audio player for Android using MediaPlayer And MediaController?

China☆狼群 提交于 2019-11-27 20:03:52

问题


I want to create an Android application that is a client for an Internet radio station. And I want it look native to Android? But im confused with Android API logic and documentation. What i've got is that I need MediaPlayer and MediaController classes. Am I right, and is there any good example of AUDIO player for Android?

Especially, I'm very interested how to use MediaPlayer and MediaController classes together.

UPD:

Finally I've got the code, that does exactly what I want:

Intent i = new Intent(Intent.ACTION_VIEW);    
Uri u = Uri.parse(%file_uri%));    
i.setData(u);    
startActivity(i);

回答1:


you can look at those links :

http://www.helloandroid.com/tutorials/musicdroid-audio-player-part-i

Hope it will help.

[EDIT]

You have also some example on the official android developer website :

http://developer.android.com/guide/topics/media/index.html



来源:https://stackoverflow.com/questions/2220575/how-to-implement-an-audio-player-for-android-using-mediaplayer-and-mediacontroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!