Search code examples
javaandroidandroid-mediaplayerandroid-sdcardandroid-contentresolver

EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI both fetch videos from internal memory card in android


I write the code which fetches videos from both MediaStore.Video.Media.EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI using context.getContentResolver().query().

But It fetches videos only from Internal Memory. I didnt fetch sdcard video files.I also add read and write permissions both on Manifest. It works on Samsung Jelly Bean but not work on Micromax A110 Jelly Bean. Please help me with this problem I tried this since last 3 days.*


Solution

  • But It fetches videos only from Internal Memory

    That will depend entirely upon the device manufacturer, and whether that manufacturer arranges to add removable media files to the MediaStore (and later remove them if that media is ejected).

    So, for example, this sample app properly shows videos on a micro SD card in my SONY Tablet Z2. It uses EXTERNAL_CONTENT_URI:

      @Override
      public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
        return(new CursorLoader(
                                getActivity(),
                                MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
                                null, null, null,
                                MediaStore.Video.Media.TITLE));
      }
    

    It works on Samsung Jelly Bean but not work on Micromax A110 Jelly Bean. Please help me with this problem I tried this since last 3 days.*

    Contact Micromax and complain about their Android implementation. Your code is probably perfectly fine, but there is nothing you can do about devices whose manufacturers do not handle removable media properly.