简体   繁体   English

如何在Android中查找歌曲标题,艺术家姓名,以便我可以在应用程序中分别显示所有属性?

[英]How to find the song title, artist name in android so that I can display all the attributes separately in my app?

I am trying to create a Media Player app using the MediaPLayer class and all that stuff. 我正在尝试使用MediaPLayer类和所有这些东西来创建Media Player应用程序。 I was able to display the song file name in one line. 我能够在一行中显示歌曲文件名。 I am finding it difficult to separate the song title, song name, movie name and display it separately in a TextView . 我发现很难分开歌曲标题,歌曲名称,电影名称并将其分别显示在TextView

You needed to search over internet before asking any question. 您需要在问任何问题之前通过互联网搜索。

     String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";
     String[] projection = { MediaStore.Audio.Media._ID,
             MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.TITLE,
             MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.DISPLAY_NAME,
             MediaStore.Audio.Media.DURATION};

     cursor = this.managedQuery(
             MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection,null, null);

     private List<String> songs = new ArrayList<String>();

     while(cursor.moveToNext()){
         songs.add(cursor.getString(0) + "||" + cursor.getString(1) + "||" +
                 cursor.getString(2) + "||" + cursor.getString(3) + "||" +
                 cursor.getString(4) + "||" + cursor.getString(5));
     }

Link To See this ,and this ,and this ,and this for custom listview 链接以查看此,用于自定义列表视图

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:如何从Shoutcast获取歌曲标题和歌手姓名? - Android: How to get Song title and Artist name from Shoutcast? 如何从媒体中检索歌曲名称和艺术家姓名 - How can I retrieve song name and artist name from media 如何在通知栏中显示歌曲名称和歌手姓名 - How to display Song Name And Artist Name In Notification Bar 我正在尝试将歌曲和歌手的名字分开 - I'm trying to separate the name of the song and the artist 如何在Android中使用Icecast Client发送带有音频的标题和艺术家名称 - How to send title & artist name with audio using icecast client in android Android应用程序开发中此添加/加号按钮的名称是否存在? 如果是这样,如何将其添加到我的应用程序中? - Is there a name for this add / plus type of button in Android app development? If so, how can I add it to my application? 如何在ListView中显示专辑封面,歌曲名称,持续时间和艺术家名称 - How to show album art , song name ,duration, and the artist name in a ListView 如何在我的应用程序后台播放 MediaPlayer 主题曲? - How can I play a MediaPlayer theme song at the background of my app? 我可以在我的 Flutter 应用程序中找到 Android 资源名称吗? - Can I find an Android resource name in my Flutter app? 当用户选择一首歌曲&gt;使用对话框完成动作&gt;在我的应用中时,如何获取歌曲详细信息 - how can i get song details, when user chooses a song>complete action using dialog> into my app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM