JAVA 获取MP3专辑封面或者相关图片.这个东西是存在于MP3文件内还是网络上下载的?

解决方案 »

  1.   

    String[] projection = {MediaStore.Audio.Media.DATA};   
            Cursor cursor = managedQuery( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,   
                    projection,   
                    null,    
                    null,    
                    null);  
            int  columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);   
            cursor.moveToFirst();  
           
            String audioPath = cursor.getString(columnIndex);   不知道有没有用
      

  2.   

    其实android自带的有乱码啥的,自己写个mp3的id3解析类或移植下开源的就可以了
      

  3.   

    ...DATE里面是MP3路径信息   不懂怎么搞啊
      

  4.   

    我也在修改android原生代码。模拟器始终没成功 public void handleMessage(Message msg)
            {
                long albumid = ((AlbumSongIdWrapper) msg.obj).albumid;
                long songid = ((AlbumSongIdWrapper) msg.obj).songid;
                if (msg.what == GET_ALBUM_ART && (mAlbumId != albumid || albumid < 0 || mIsShowAlbumArt)) {
                    Message numsg = null;
                    // while decoding the new image, show the default album art
                    if (mArtBitmap == null || mArtSongId != songid) {
                        numsg = mHandler.obtainMessage(ALBUM_ART_DECODED, null);
                        mHandler.removeMessages(ALBUM_ART_DECODED);
                        mHandler.sendMessageDelayed(numsg, 300);                    // Don't allow default artwork here, because we want to fall back to song-specific
                        // album art if we can't find anything for the album.
                        // add by jackie: if don't get album art from file,or the album art is not the same as
                        // the song ,we should get the album art again
                        mArtBitmap = MusicUtils.getArtwork(MediaPlaybackActivity.this, songid, albumid, false);
                        MusicLogUtils.d(TAG, "get art. mArtSongId = " + mArtSongId + " ,songid = " + songid + " ");
                        mArtSongId = songid;
                    }
                    
                    if (mArtBitmap == null) {
                        mArtBitmap = MusicUtils.getDefaultArtwork(MediaPlaybackActivity.this);
                        albumid = -1;
                    }
                    if (mArtBitmap != null) {
                        numsg = mHandler.obtainMessage(ALBUM_ART_DECODED, mArtBitmap);
                        mHandler.removeMessages(ALBUM_ART_DECODED);
                        mHandler.sendMessage(numsg);
                    }
                    mAlbumId = albumid;
                    mIsShowAlbumArt = false;
                }
            }这应该是获取图片。楼主解决没?分享下