No, Android Does *Not* Have a Crop Intent
Many developers are calling
startActivity() on an
an action of
com.android.camera.action.CROP. They are doing this
to crop an image.
This is a really bad idea.
Any time you find yourself typing or pasting something starting
com.android, warning bells should be sounding. Better yet,
the “Lost in Space” Robot should amble toward you, waving his arms,
“Danger, Will Robinson! Danger!”
(note: while your name may not be Will Robinson, if a robot is flailing about in your vicinity, just play along, m’kay?)
In this specific case, this
Intent action is supported by the
AOSP Camera app. That app does not exist on all devices. Devices
lacking this app will not respond to this undocumented
and your app will crash.
There are several open source libraries for cropping images in Android.
I have not tried any of them, and therefore cannot vouch for how well
any work. However, they are safer bets than relying upon an undocumented
Intent action from an app that may not exist on any given user’s device.
Here are some libraries to consider:
- https://github.com/MMP-forTour/cropimage (forked from the above one)