- Add library to your project
- In
AndroidManifest.xml
write in your<application>
next:
<activity android:name="com.idap.imageutils.ImageUtilsActivity"/>
_```_
3. If you want take photo from camera:
```java
ImageUtils.takePhoto(ACTIVITY_OR_FRAGMENT, YOUR_REQUEST_CODE);
from device:
ImageUtils.getImageFromGallery(ACTIVITY_OR_FRAGMENT, YOUR_REQUEST_CODE);
If your targetSdkVersion
is 23
or higher dont forget about Runtime Permissions
.
- In
onActivityResult
do next
if(requestCode == YOUR_REQUEST_CODE && resultCode == Activity.RESULT_OK){
imagePath = data.getExtras().getString(ImageUtils.IMAGE_PATH_KEY);
//or
// imagePath = ImageUtils.getImagePath(data);
}
Path to image: /storage/emulated/0/Android/data/{your_project}/files/tmp/
- ./gradew assemble
- ./gradew install
- ./gradew bintrayUpload