Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.database.Cursor; import android.provider.MediaStore.Images.Media; public class Main { public static String getImagePath(Context context, String id) { String path = null; Cursor cursor = context.getContentResolver().query(Media.EXTERNAL_CONTENT_URI, null, Media._ID + "=?", new String[] { id }, null); while (cursor.moveToNext()) { path = cursor.getString(cursor.getColumnIndex(Media.DATA)); } cursor.close(); return path; } }