Android Custom KYC Camera
- Custom camera interface for Indian ID card (Aadhaar Card, Pan Card)
- 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.Gauravhulmukh:KYCCamera:v1.1'
}
- Front side of Aadhaar Card
KYCCamera.create(this).openCamera(KYCCamera.TYPE_AADHAARCARD_FRONT);
- Back side of Aadhaar Card
KYCCamera.create(this).openCamera(KYCCamera.TYPE_AADHAARCARD_BACK);
- Front side of Pan Card
KYCCamera.create(this).openCamera(KYCCamera.TYPE_PANCARD_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_AADHAARCARD_FRONT) { //Front of AADHAAR card
acf.setImageBitmap(BitmapFactory.decodeFile(path));
} else if (requestCode == KYCCamera.TYPE_AADHAARCARD_BACK) { //Reverse side of AADHAAR card
acb.setImageBitmap(BitmapFactory.decodeFile(path));
} else if (requestCode == KYCCamera.TYPE_PANCARD_FRONT) { //Front of PAN card
pcf.setImageBitmap(BitmapFactory.decodeFile(path));
}
}
}
}
FileUtils.clearCache(this);
Copyright 2021 GauravHulmukh
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.