Using Intent.ACTION_PICK for specific path

Sorry, no this is not possible. Also you are using this Intent protocol wrong. As per http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK this protocol expects that you put the content: URI of the data set you want the picker to select from. That said, you should consider ACTION_PICK deprecated. The modern action is ACTION_GET_CONTENT which is much better supported; you … Read more

android:select image from gallery then crop that and show in an imageview

Hope This Code will help you.. Activity To Select The Image From Gallery. import java.io.File; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.util.Log; public class GalleryUtil extends Activity{ private final static int RESULT_SELECT_IMAGE = 100; public static final int MEDIA_TYPE_IMAGE = 1; private static final String TAG = “GalleryUtil”; … Read more

List all camera images in Android

The Gallery app obtains camera images by using a content resolver over Images.Media.EXTERNAL_CONTENT_URI and filtering the results by Media.BUCKET_ID. The bucket identifier is determined with the following code: public static final String CAMERA_IMAGE_BUCKET_NAME = Environment.getExternalStorageDirectory().toString() + “/DCIM/Camera”; public static final String CAMERA_IMAGE_BUCKET_ID = getBucketId(CAMERA_IMAGE_BUCKET_NAME); /** * Matches code in MediaProvider.computeBucketValues. Should be a common * … Read more

Get list of photo galleries on Android

Groupings are defined by MediaStore.Images.Media.BUCKET_DISPLAY_NAME. Here is the sample code to list the images and log their bucket name and date_taken: // which image properties are we querying String[] projection = new String[] { MediaStore.Images.Media._ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATE_TAKEN }; // content:// style URI for the “primary” external storage volume Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; // Make the … Read more

android : deleting an image

Use the code below, it may help you. File fdelete = new File(file_dj_path); if (fdelete.exists()) { if (fdelete.delete()) { System.out.println(“file Deleted :” + file_dj_path); } else { System.out.println(“file not Deleted :” + file_dj_path); } } to refresh gallery after deleting image use below code for send Broadcast (for < KITKAT API 14) sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(“file://” … Read more

Android get image from gallery into ImageView

Simple pass Intent first: Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, RESULT_LOAD_IMAGE); And you will get picture path on your onActivityResult: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA … Read more

Android: Bitmaps loaded from gallery are rotated in ImageView

So, as an example… First you need to create an ExifInterface: ExifInterface exif = new ExifInterface(filename); You can then grab the orientation of the image: orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1); Here’s what the orientation values mean: http://sylvana.net/jpegcrop/exif_orientation.html So, the most important values are 3, 6 and 8. If the orientation is ExifInterface.ORIENTATION_ROTATE_90 (which is 6), for … Read more

Image, saved to sdcard, doesn’t appear in Android’s Gallery app

A simpler solution is to use the static convenience method scanFile(): File imageFile = … MediaScannerConnection.scanFile(this, new String[] { imageFile.getPath() }, new String[] { “image/jpeg” }, null); where this is your activity (or whatever context), the mime-type is only necessary if you are using non-standard file extensions and the null is for the optional callback … Read more