Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use this method develop3ed by me.... for getting mp3 files of sd card</p> <p>For getting detailed I also have asked an question <strong><a href="https://stackoverflow.com/questions/15899110/detecting-changes-in-android-content-observer-for-audio-media-external-content-u">Observing changes in android content observer for Audio.Media.EXTERNAL_CONTENT_URI</a></strong></p> <p>This code will work for both <strong>mnt/sdcrad</strong> and <strong>extSdCard</strong> </p> <p>In this code I have retrieved</p> <ol> <li><p>File Name</p></li> <li><p>File Path</p></li> <li><p>Time</p></li> <li><p>Duration </p></li> </ol> <p>for each mp3 file. There are so many fields that you can retrieve refer this <a href="http://developer.android.com/reference/android/provider/MediaStore.Audio.AudioColumns.html" rel="nofollow noreferrer">http://developer.android.com/reference/android/provider/MediaStore.Audio.AudioColumns.html</a></p> <pre><code> private void showAllAudio() { Cursor mCursor = null; try { mCursor = context.getContentResolver().query( Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, "_id"); System.out.println("Cursor count is " + mCursor.getCount()); if (mCursor.getCount() != 0) { do { long date = mCursor.getLong(mCursor .getColumnIndexOrThrow(Audio.Media.DATE_ADDED)); String Duration = mCursor.getString(mCursor .getColumnIndexOrThrow(Audio.Media.DURATION)); String DISPLAY_NAME = mCursor.getString(mCursor .getColumnIndexOrThrow(Audio.Media.DISPLAY_NAME)); String DATA = mCursor.getString(mCursor .getColumnIndexOrThrow(Audio.Media.DATA)); double TIME_STAMP = mCursor.getInt(mCursor .getColumnIndexOrThrow(Audio.Media.DATE_ADDED)); System.out.println("Name:" + DISPLAY_NAME); System.out.println("data " + DATA); System.out.println("time " + TIME_STAMP); System.out.println("time " + Duration); } while (mCursor.moveToNext()); } } catch (Exception e) { e.printStackTrace(); } finally { if (mCursor != null) { mCursor.close(); mCursor = null; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload