Note: This repository was deprecated. Please, check our new Android-Parsing-SDK
This project demonstrates how to use Driver License Parser library for Android from IDScan.net.
-
Add idscan-public maven repository:Starting from v1.30.0, artifacts are published in Maven Central. Thus, no additional repositories are required. So if you have previously definedmaven { url = uri("https://www.myget.org/F/idscan-public/maven/") }
repository anywhere, please remove it. -
Add the following to the module build.gradle file:
dependencies { ... implementation 'net.idscan.components.android:dlparser-standard:1.30.0' ... }
Note if you have already installed version before 1.28.4 you have to remove it from the project.
- Create
DLParser
object.
DLParser parser = new DLParser();
- Setup License Key. For setup License Key you need to call
setup(Context, String)
. It accepts two parameters: application context and license key encoded as Base64 string.
try { parser.setup(getApplicationContext(), "** LICENSE_KEY **"); } catch(DLParserException e) { // TODO: handle the error. }
- Parse the data. For parsing data you need to call
parse(byte[])
method.
try { DLResult res = parser.parse(data); } catch(DLParserException | UnsupportedEncodingException e) { // TODO: handle the error. }
You will find a complete example of using the library in MainActivity.java
.