0

I am trying to use MediaStore to get all images in phone/tablet. I am succesful with that.

 String[] projection = new String[]{
            MediaStore.Images.Media.DATA,
            MediaStore.Images.Media.BUCKET_DISPLAY_NAME
    };
 Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
 Cursor cur = activity.getContentResolver().query(images,
            projection, // Which columns to return
            "",         // Which rows to return (all rows)
            null,       // Selection arguments (none)
            ""          // Ordering
    );
 if (cur.moveToFirst()) {
     String photo;
     String album;
     int bucketColumn = cur.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);
     int photoColumn = cur.getColumnIndex(MediaStore.Images.Media.DATA);
     album = cur.getString(bucketColumn);
     photo = cur.getString(photoColumn);
 }//Just parts of code

I want to create GridView with images I get from MediaStore.


Problems is when there is a lot of pictures it gets a little problematic. I use Universal Image Loader so its ok but I need it really really fast so I found that Android is supposed to have his own thumbnails of pictures stored in MediaStore.Images.Thumbnail so I will not have to create my own thumbnails.

Get thumbnail Uri/path of the image stored in sd card + android

Doesn't seem to work either. I looked in external database of device and there was nothing.

Community
  • 1
  • 1
TheLibrarian
  • 1,540
  • 1
  • 11
  • 22

1 Answers1

1

Have a look at Lucas Rochas smoothie library. This libary implements fast scrolling grids. I use it on my Playlist Manager(google play). http://lucasr.org/2013/01/06/introducing-smoothie/

Theo
  • 2,012
  • 1
  • 16
  • 29
  • Thank you for the answer but what I got is quite dificult. I have to put out images to a gridview and those images have to be sorted by date when they were taken ( StickyGridHeader ) and inside this I had to set the picture. Now I am using Universal Image Loader but it loads full images. This is just saying where I need to use it, sadly I understood that Smoothie cannot do that. – TheLibrarian Sep 07 '14 at 13:34
  • If you want to load images, resize so that they fit your grid, and fast scrolling, smoothie library will do that for you. The sorting is irrelevant to displaying as your query should provide the cursor sorted as required. – Theo Sep 08 '14 at 16:19