NIK offline validator
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
// other code
maven { url 'https://jitpack.io' }
}
}
Or if using settings.gradle:
dependencyResolutionManagement {
// other code
repositories {
// other code
maven { url 'https://jitpack.io' }
}
}
Next add the dependency:
dependencies {
implementation 'com.github.dzakdzaks:NIKParser:{LATEST_VERSION}'
}
Then use it:
val nikParser: NIKParser = NIKParserImpl(context)
val nikParseResult = nikParser.parseNik(string)
{
"nik": "3276055708900002",
"isValid": true,
"province": {
"id": "32",
"name": "Jawa Barat"
},
"regency": {
"id": "3276",
"name": "Kota Depok"
},
"district": {
"id": "327605",
"name": "Sukmajaya",
"zipCode": "16417"
},
"birthDate": "1990-08-17",
"gender": "female",
"uniqueCode": "0002"
}