use of android.net.Uri in project photo-picker-plus-android by chute.
the class MediaDAO method getLastVideoThumbnailFromCameraVideos.
/**
* Returns the last video thumbnail URI from the camera videos on the
* device.
*
* @param context The application context.
* @return The URI for the requested query.
*/
public static Uri getLastVideoThumbnailFromCameraVideos(final Context context) {
Cursor cameraVideos = getCameraVideosThumbnails(context);
Uri uri = getFirstVideoThumbnailUri(cameraVideos);
safelyCloseCursor(cameraVideos);
if (uri == null) {
return Uri.parse("");
}
return uri;
}
use of android.net.Uri in project photo-picker-plus-android by chute.
the class MediaDAO method getLastPhotoFromCameraPhotos.
/**
* Returns the last photo URI from the camera photos on the device.
*
* @param context The application context.
* @return The URI for the requested query.
*/
public static Uri getLastPhotoFromCameraPhotos(final Context context) {
Cursor cameraPhotos = getCameraPhotos(context);
Uri uri = getFirstImageItemUri(cameraPhotos);
safelyCloseCursor(cameraPhotos);
if (uri == null) {
return Uri.parse("");
}
return uri;
}
use of android.net.Uri in project photo-picker-plus-android by chute.
the class MediaDAO method getLastVideoCursor.
/**
* Request a specific record in {@link android.provider.MediaStore.Video.Media} database.
*
* @param context The application context.
* @return Cursor object enabling read-write access to all videos on the
* device.
*/
public static Cursor getLastVideoCursor(final Context context) {
final String[] projection = new String[] { MediaStore.Video.Media._ID, MediaStore.Video.Media.DATA };
final Uri videos = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
final String query = MediaStore.Video.Media.DATA + " LIKE \"%DCIM%\"";
return context.getContentResolver().query(videos, projection, query, null, MediaStore.Video.Media.DATE_TAKEN);
}
use of android.net.Uri in project photo-picker-plus-android by chute.
the class MediaDAO method getLastPhotoContentUri.
public static Uri getLastPhotoContentUri(Context context) {
Cursor cursor = getCameraPhotos(context);
Uri uri = null;
if (cursor != null && cursor.moveToFirst()) {
uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cursor.getInt(cursor.getColumnIndex(MediaStore.Images.Media._ID)));
}
safelyCloseCursor(cursor);
return uri;
}
use of android.net.Uri in project photo-picker-plus-android by chute.
the class MediaDAO method getCameraVideos.
/**
* Request a specific record in {@link android.provider.MediaStore.Video.Media} database.
*
* @param context The application context.
* @return Cursor object enabling read-write access to camera videos on the
* device.
*/
public static Cursor getCameraVideos(final Context context) {
final String[] projection = new String[] { MediaStore.Video.Media._ID, MediaStore.Video.Media.DATA };
final Uri videos = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
final String query = MediaStore.Video.Media.DATA + " LIKE \"%DCIM%\"";
return context.getContentResolver().query(videos, projection, query, null, MediaStore.Video.Media.DEFAULT_SORT_ORDER);
}
Aggregations