From ad4061edaff432af66dc4f96d539e7627a920208 Mon Sep 17 00:00:00 2001 From: Ivan Grce Date: Fri, 8 Apr 2016 15:26:38 +0200 Subject: [PATCH] Updated Android SDK to v2.5.0 --- BlinkID/src/android/blinkid-android | 2 +- .../plugins/blinkid/BlinkIdScanner.java | 19 ++++++---- Release notes.md | 3 ++ index.js | 38 +++++++++---------- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/BlinkID/src/android/blinkid-android b/BlinkID/src/android/blinkid-android index 868d8cc..e7108ad 160000 --- a/BlinkID/src/android/blinkid-android +++ b/BlinkID/src/android/blinkid-android @@ -1 +1 @@ -Subproject commit 868d8cc44dbdf853f95639ec3f925b629a1176a6 +Subproject commit e7108add07751d3070d66fc0fad52b9b597d858b diff --git a/BlinkID/src/android/java/com/phonegap/plugins/blinkid/BlinkIdScanner.java b/BlinkID/src/android/java/com/phonegap/plugins/blinkid/BlinkIdScanner.java index eba43f2..bd4fc1a 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/blinkid/BlinkIdScanner.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/blinkid/BlinkIdScanner.java @@ -29,8 +29,9 @@ import com.microblink.recognizers.blinkid.malaysia.MyKadRecognizerSettings; import com.microblink.recognizers.blinkid.mrtd.MRTDRecognitionResult; import com.microblink.recognizers.blinkid.mrtd.MRTDRecognizerSettings; -import com.microblink.recognizers.blinkid.ukdl.UKDLRecognitionResult; -import com.microblink.recognizers.blinkid.ukdl.UKDLRecognizerSettings; +import com.microblink.recognizers.blinkid.eudl.EUDLCountry; +import com.microblink.recognizers.blinkid.eudl.EUDLRecognitionResult; +import com.microblink.recognizers.blinkid.eudl.EUDLRecognizerSettings; import com.microblink.recognizers.settings.RecognitionSettings; import com.microblink.recognizers.settings.RecognizerSettings; import com.microblink.results.barcode.BarcodeDetailedData; @@ -218,9 +219,11 @@ private MRTDRecognizerSettings buildMrtdSettings() { return mrtd; } - private UKDLRecognizerSettings buildUkdlSettings() { - // prepare settings for United Kingdom Driver's Licence recognizer - UKDLRecognizerSettings ukdl = new UKDLRecognizerSettings(); + private EUDLRecognizerSettings buildUkdlSettings() { + // To specify we want to perform EUDL (EU Driver's License) recognition, + // prepare settings for EUDL recognizer. Pass country as parameter to EUDLRecognizerSettings + // constructor. Here we choose UK. + EUDLRecognizerSettings ukdl = new EUDLRecognizerSettings(EUDLCountry.EUDL_COUNTRY_UK); // Defines if issue date should be extracted. Default is true ukdl.setExtractIssueDate(true); // Defines if expiry date should be extracted. Default is true. @@ -364,8 +367,8 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { resultsList.put(buildMRTDResult((MRTDRecognitionResult) res)); } else if (res instanceof USDLScanResult) { // check if scan result is result of US Driver's Licence recognizer resultsList.put(buildUSDLResult((USDLScanResult) res)); - } else if (res instanceof UKDLRecognitionResult) { // check if scan result is result of UKDL recognizer - resultsList.put(buildUKDLResult((UKDLRecognitionResult) res)); + } else if (res instanceof EUDLRecognitionResult) { // check if scan result is result of EUDL recognizer + resultsList.put(buildUKDLResult((EUDLRecognitionResult) res)); } else if (res instanceof MyKadRecognitionResult) { // check if scan result is result of MyKad recognizer resultsList.put(buildMyKadResult((MyKadRecognitionResult) res)); } @@ -452,7 +455,7 @@ private JSONObject buildMyKadResult(MyKadRecognitionResult res) throws JSONExcep return buildKeyValueResult(res, MYKAD_RESULT_TYPE); } - private JSONObject buildUKDLResult(UKDLRecognitionResult res) throws JSONException{ + private JSONObject buildUKDLResult(EUDLRecognitionResult res) throws JSONException{ return buildKeyValueResult(res, UKDL_RESULT_TYPE); } diff --git a/Release notes.md b/Release notes.md index 63435ba..be73786 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,6 @@ +## 1.0.2 +- updated [Android SDK](https://github.com/BlinkID/blinkid-android) to v2.5.0 + ## 1.0.1 - updated [Android SDK](https://github.com/BlinkID/blinkid-android) to v2.2.0 diff --git a/index.js b/index.js index 2076291..b1c8bf9 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ var app = { * Use these scanner types * Available: "PDF417", "USDL", "Bar Decoder", "Zxing", "MRTD", "UKDL", "MyKad" */ - var types = ["PDF417", "UKDL", "MRTD"]; + var types = ["PDF417", "UKDL", "MRTD"]; // Note that each platform requires its own license key @@ -65,23 +65,23 @@ var app = { scanButton.addEventListener('click', function() { cordova.plugins.blinkIdScanner.scan( - // Register the callback handler + // Register the callback handler function callback(scanningResult) { // handle cancelled scanning if (scanningResult.cancelled == true) { - resultDiv.innerHTML = "Cancelled!"; - return; - } - - // Obtain list of recognizer results - var resultList = scanningResult.resultList; - - // Iterate through all results - for (var i = 0; i < resultList.length; i++) { + resultDiv.innerHTML = "Cancelled!"; + return; + } + + // Obtain list of recognizer results + var resultList = scanningResult.resultList; + + // Iterate through all results + for (var i = 0; i < resultList.length; i++) { // Get individual resilt - var recognizerResult = resultList[i]; + var recognizerResult = resultList[i]; if (recognizerResult.resultType == "Barcode result") { // handle Barcode scanning result @@ -123,7 +123,7 @@ var app = { } else if (recognizerResult.resultType == "MRTD result") { - var fields = recognizerResult.fields; + var fields = recognizerResult.fields; resultDiv.innerHTML = /** Personal information */ "Family name: " + fields[kPPmrtdPrimaryId] + "; " + @@ -139,8 +139,8 @@ var app = { "Opt1: " + fields[kPPmrtdOpt1] + "; " + "Opt2: " + fields[kPPmrtdOpt2] + "; "; - } else if (recognizerResult.resultType == "UKDL result") { - + } else if (recognizerResult.resultType == "UKDL result") { + var fields = recognizerResult.fields; resultDiv.innerHTML = /** Personal information */ @@ -153,8 +153,8 @@ var app = { "First name: " + fields[kPPukdlFirstName] + "; " + "Last name: " + fields[kPPukdlLastName] + "; "; - } else if (recognizerResult.resultType == "MyKad result") { - + } else if (recognizerResult.resultType == "MyKad result") { + var fields = recognizerResult.fields; resultDiv.innerHTML = /** Personal information */ @@ -165,8 +165,8 @@ var app = { "Full Name: " + fields[kPPmyKadFullName] + "; " + "Religion: " + fields[kPPmyKadReligion] + "; " + "Sex: " + fields[kPPmyKadSex] + "; "; - } - } + } + } }, // Register the error callback