package com.dyhpoon.fodex.data;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.provider.MediaStore;

/**
 * Created by darrenpoon on 28/1/15.
 */
public class FodexCursor {

    public static Cursor allPhotosCursor(Context context) {
        ContentResolver resolver = context.getContentResolver();
        String[] projection = new String[]{
                MediaStore.Images.Media._ID,
                MediaStore.Images.Media.DATA,
                MediaStore.Images.Media.DATE_TAKEN,
        };
        Cursor cursor = resolver.query(
                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                projection,
                null,
                null,
                MediaStore.Images.Media.DATE_ADDED + " DESC"
        );
        return cursor;
    }

}

@@ -66,16 +66,52 @@
 solver;%0A
+import android.content.ContentUris;%0A
 import a
@@ -134,16 +134,16 @@
 ontext;%0A
-
 import a
@@ -166,16 +166,40 @@
 Cursor;%0A
+import android.net.Uri;%0A
 import a
@@ -869,16 +869,16 @@
      );%0A
-
         
@@ -899,10 +899,889 @@
 %0A    %7D%0A%0A
+    public static Uri getThumbnail(Context context, int imageId) %7B%0A        ContentResolver resolver = context.getContentResolver();%0A        String%5B%5D projection = new String%5B%5D %7B%0A                MediaStore.Images.Thumbnails._ID%0A        %7D;%0A        Cursor cursor = MediaStore.Images.Thumbnails.queryMiniThumbnail(%0A                resolver,%0A                imageId,%0A                MediaStore.Images.Thumbnails.MINI_KIND,%0A                projection);%0A        final int idColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);%0A        if (cursor.moveToFirst()) %7B%0A            final String id = cursor.getString(idColumn);%0A            cursor.close();%0A            return ContentUris.withAppendedId(%0A                    MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,%0A                    Long.parseLong(id));%0A        %7D else %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Add function to get thumbnail's url with image id.