Deprecated and not maintained now.
This library is deprecated now. I am working on a new library which will be have more features and new api support.
image-intent-handler
Easiest way to handle image via camera and gallery intent.
####Features:
- Resize Image in specific size and folder
- Take care of
OutOfMemoryException
- Take care of image rotation while camera capture
####Installation:
compile 'me.himanshusoni.iih:iih-library:0.9.2'
####Sample Use:
- Create an
ImagePair
ImageIntentHandler.ImagePair mImagePair;
- Fire intent:
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File f = ImageUtils.createImageFile(ImageUtils.getPackageName(HomeActivity.this));
if ((f != null) && f.exists()) {
mImagePair = new ImageIntentHandler.ImagePair(mImageView, f.getAbsolutePath());
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
startActivityForResult(takePictureIntent, ImageIntentHandler.REQUEST_CAPTURE);
}
else {
Toast.makeText(HomeActivity.this, "Storage Error", Toast.LENGTH_LONG).show();
}
OR
mImagePair = new ImageIntentHandler.ImagePair(mImageView, null);
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, ImageIntentHandler.REQUEST_GALLERY);
- Tell ImageIntentHandler to handle result:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ImageIntentHandler intentHandler =
new ImageIntentHandler(HomeActivity.this, mImagePair)
.folder("IIH Sample")
.sizeDp(200);
intentHandler.handleIntent(requestCode, resultCode, data);
}
================== developed to make programming easy.
by Himanshu Soni ( [email protected])