Android IdCamCapture
Note: Camera only open in PORTRAIT ORIENTATION.
- Open Front Camera to capture face
- Get Captured result with or without cropping
- Support to turn on/off flash
- Support touch screen for focusing
- Support automatic clipping of images
- Support manual irregular clipping of images
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.AshwinN796:IdCamCapture:v1.0.1'
}
- ID Capture without crop
KYCCamera.create(this).openCamera(KYCCamera.TYPE_CAPTURE_ID_WO_CROP);
- Capture face without crop
KYCCamera.create(this).openCamera(KYCCamera.TYPE_CAPTURE_FACE_WO_CROP);
- Capture face with Crop
KYCCamera.create(this).openCamera(KYCCamera.TYPE_CAPTURE_FACE_FRONT);
notice: The parameters of the create() method are passed the context, activity.this is passed in Activity, and fragment.this is passed in Fragment.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == KYCCamera.RESULT_CODE) {
//Get image path,display image
final String path = KYCCamera.getImagePath(data);
if (!TextUtils.isEmpty(path)) {
if (requestCode == KYCCamera.TYPE_CAPTURE_ID_WO_CROP) { //Front of AADHAAR card
} else if (requestCode == KYCCamera.TYPE_CAPTURE_FACE_WO_CROP) { //Front capture without crop
} else if (requestCode == KYCCamera.TYPE_CAPTURE_FACE_FRONT) { //Front photo with cropped result
}
}
}
}
FileUtils.clearCache(this);