歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Android之Audio常用屬性變量

Android之Audio常用屬性變量

 歌曲ID:MediaStore.Audio.Media._ID
 Int id = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media._ID));
 歌曲的名稱 :MediaStore.Audio.Media.TITLE
 String tilte = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE));
 歌曲的專輯名:MediaStore.Audio.Media.ALBUM
 String album = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM));
 歌曲的歌手名: MediaStore.Audio.Media.ARTIST
 String artist = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));
 歌曲文件的全路徑 :MediaStore.Audio.Media.DATA
 String url = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA));
 歌曲文件的名稱:MediaStroe.Audio.Media.DISPLAY_NAME
 String display_name = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME));
 歌曲文件的發行日期:MediaStore.Audio.Media.YEAR
 String year = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.YEAR));
 歌曲的總播放時長 :MediaStore.Audio.Media.DURATION
 Int duration = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION));
 歌曲文件的大小 :MediaStore.Audio.Media.SIZE
 Int size = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.SIZE));

更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11

Copyright © Linux教程網 All Rights Reserved