This is an SDK to determine how to Extract document details by ML kit, Detect and extract Face by camera and How to extract and decrypt Passport details by NFC tag
I've separated it into 3 major functionality
- Extract Face by front camera
- Check if just one face exists in the frame and it is in the correct area
- Scan and extract Texts from documents by back camera
- Developer can define mandatory strings list (name, family or ...) to check
- Extract and Decrypt Passport details by NFC tag
Full Kotlin, ML KIT, Camera, NFC reader, Junit/Espresso
1- Add EKYC library to your project
2- For Extract simple documents :
ExtractDocumentActivity.start(
activity = this
)
3- For Extract documents with mandatory fields :
ExtractDocumentActivity.start(
activity = this
mandatoryFields = arrayListOf("name , family")
)
4- For face detection :
FaceDetectionActivity.start(this)
5- For Extract Passport by NFC tag :
GetDataForNFCEncryptionActivity.start(this)
6- For get the results :
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
//face detection
if (requestCode == KYC.FACE_DETECTION_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
//face detected
val fileAddress = data?.getStringExtra(IMAGE_URL)
fileAddress.toast(this)
}
}
//document extraction
if (requestCode == KYC.SCAN_DOCUMENT_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
val fileAddress = data?.getStringExtra(IMAGE_URL)
val results = data?.getStringExtra(RESULTS)
"$fileAddress $results".toast(this)
}
}
//NFC extraction
if (requestCode == KYC.SCAN_PASSPORT_NFC_RESULTS_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
val results = data?.getSerializableExtra(RESULTS)
"$results".toast(this)
}
}
}
Also I'm using GitHub Actions as CI/CD. As I defined before, If I push the codes into any branch except master/release, All tests will run, Then If all of them passed, one APK will be built and uploads into the Github actions artifact.
AmirHossein Teymoori [email protected]