菜鸟求助,关于音乐播放器的问题 请教一下:像酷狗音乐,天天动听这些音乐播放器是怎么在播放歌曲时下载歌手的图片还有专辑的图片的呢?去哪下载的啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果是mp3文件,也许在其id3信息中会有专辑图片,但不是每个mp3文件都有的。类似酷狗或者天天动听,肯定有他们自己服务器,这些服务器上肯定都有一套他们自己曲库,这些曲库里面应该有相关的图片信息,客户端从自己的服务器上下载就好。 音乐播放器 一般有一个乐库显示一些他提供的歌曲。 然后可以从乐库添加歌曲到客户端来。添加歌曲的接口中会带上一些数据 例如歌曲的URL、歌曲专辑图片的URL、歌手头像等等客户端这边得到这些数据以后 就从服务器去下载所需要的。这个没有什么网站提供歌手图片的结构吧 你好,还是付一段代码给你看看,可能会更直观 long albumid;albumid = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID)); public String getAlbum(albumid ,Context context) { String mUriAlbums = "content://media/external/audio/albums"; String[] projection = new String[] { "album_art" }; String album_art = null; Cursor cursor = context.getContentResolver().query( Uri.parse(mUriAlbums + "/" + Long.toString(album_id)), projection, null, null, null); if (cursor.getCount() > 0 && cursor.getColumnCount() > 0) { cursor.moveToNext(); album_art = cursor.getString(0); Log.d("TAG", "album_id = " + album_id); Log.d("TAG", "album_art = " + album_art); } cursor.close(); cursor = null; return album_art; } String album_art = readFromSD.getAlbum((Long) //album_photo 是ImageView组件list.get(currpos).get("albumid") ,MyPlayer.this); if (album_art != null) { album_photo.setImageBitmap(BitmapFactory.decodeFile(album_art)); } else { //album_photo.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.photo)); album_photo.setImageResource(R.drawable.photo); } 使单词变色 内存溢出,如何释放资源 关于android push推送 android访问sqlserver,数据量较大。 一个崩溃问题,请Android高手赐教 hello,大家好,请问大家如何在一个包内添加2个widget 谁知道怎修改百度地图的弹出窗口怎么加入layout,标签能加吗? android java.lang.NoSuchMethodError: javax.sip.SipFactory.setPathName eclipse关于导入外部库失败的问题 android 调用系统录制视频程序 返回mp4 怎么写一个动态的TabHost 求问一个简单布局的实现
long albumid;
albumid = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
public String getAlbum(albumid ,Context context)
{
String mUriAlbums = "content://media/external/audio/albums";
String[] projection = new String[] { "album_art" };
String album_art = null;
Cursor cursor = context.getContentResolver().query(
Uri.parse(mUriAlbums + "/" + Long.toString(album_id)),
projection, null, null, null);
if (cursor.getCount() > 0 && cursor.getColumnCount() > 0)
{
cursor.moveToNext();
album_art = cursor.getString(0);
Log.d("TAG", "album_id = " + album_id);
Log.d("TAG", "album_art = " + album_art);
}
cursor.close();
cursor = null;
return album_art;
} String album_art = readFromSD.getAlbum((Long)
//album_photo 是ImageView组件
list.get(currpos).get("albumid") ,MyPlayer.this);
if (album_art != null) {
album_photo.setImageBitmap(BitmapFactory.decodeFile(album_art));
}
else {
//album_photo.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.photo));
album_photo.setImageResource(R.drawable.photo);
}