Android Utililty Methods URI to Path Convert

List of utility methods to do URI to Path Convert

Description

The list of methods to do URI to Path Convert are organized into topic(s).

Method

StringgetRealPathFromURI(Activity activity, Uri contentUri)
Get the real file path from URI registered in media store
String[] proj = { MediaStore.Images.Media.DATA };
String strFileName = "";
Cursor cursor = activity.managedQuery(contentUri, proj, null, null,
        null);
if (cursor != null) {
    int column_index = cursor
            .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
    activity.startManagingCursor(cursor);
...
StringgetRealPathFromURI(Activity activity, Uri contentUri)
get Real Path From URI
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = activity.managedQuery(contentUri, proj, null, null,
        null);
int column_index = cursor
        .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
if (cursor.moveToFirst()) {
    return cursor.getString(column_index);
} else {
...