I have my main project which gets images from certain sources (returns Uri). The next step was to crop the image to scale (touch input). I recently found out that some phone manufacturer mess around with the android base classes so:
com.android.camera.action.crop
doesn’t always exist.
So I’ve found a library that does cropping: https://github.com/lvillani/android-cropimage
I’ve added the library into my eclipse build path and project library’s.
my question is, can I open the library like so:
Intent intent = new Intent("com.android.camera.action.CROP");
//intent.setClassName("com.android.camera", "com.android.camera.CropImage");
intent.setDataAndType(uri, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("output", Uri);
intent.putExtra("outputFormat", "JPEG");
startActivityForResult(intent, 1);
And then retrieve the cropped image or do I have to do something else extra?
- Another question: Also will this effect my app when I put it onto market (will the user need to download or accept permission for the extra library?
I want to make sure that my app works on everything, so is this the best way of doing it? Or is there better methods, please explain. (Also keep it simple, fairly new to Android dev!, thanks!)
I installed the library and made sure it was linking to my project and was in the build path, then I simply did:
Open file manager:
Alternatively if you want to capture from camera
Then crop image:
I’ve tested this on a few devices and it’s working fine and dandy. Also works with camera.