Skip to content
DEPRECATED; Easiest way to handle image via camera and gallery intent.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
iih-library
.gitignore
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

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.

Android Arsenal

####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:

  1. Create an ImagePair
ImageIntentHandler.ImagePair mImagePair;
  1. 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);
  1. 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 (himanshusoni.me@gmail.com)

You can’t perform that action at this time.