Hi, In this regard, I was just thinking, if I can somehow map the MediaStore.Audio.Media.TITLE to its corresponding absolute path, I should be able to play it without issues(my earlier version of playSong() method was doing just that), but I'm not yet to find a way to do that. Would appreciate if someone can point me in the right direction.
Thanks, KK On Tue, Sep 27, 2011 at 9:47 PM, KK <dioxide.softw...@gmail.com> wrote: > Hi All, > As part of my basic mp3 player, I'm using the inbuilt media player to play > songs. The problem I'm facing is that, though I'm able to get "TITLE" but > during playing the song, when I query for "DATA" field as below ( the full > code for quick viewing is give below.) > > *private void playSong(int position) {* > * try {* > * int column_index = mCursor* > * .getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);* > * mCursor.moveToPosition(position);* > * String filename = mCursor.getString(column_index);* > * Log.v(TAG, "Current Title:" + mCursor.getString(column_index));* > * if (mp.isPlaying()) {* > * mp.reset();* > * }* > * mp.setDataSource(filename);* > * mp.prepare();* > * mp.setOnCompletionListener(new OnCompletionListener() {* > * // Setup listener so next song starts automatically* > * @Override* > * public void onCompletion(MediaPlayer arg0) {* > * nextSong();* > * }* > * });* > * mp.start();* > * } catch (Exception e) {* > * Log.e(TAG, "Exception in playsong():" + e.getMessage());* > * }* > * }* > > its giving me the following errors: > 09-27 21:29:30.980: ERROR/Mp3Player(633): Exception in playsong():*column > '_data' does not exist* > > Is there any way, I can get around with this and still play these mp3 > files. The mp3 files I'm using are the ones commonly available on the web > and might be missing the metadata. > > Any help would be appreciated. > > Thanks, > KK > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en