Skip to content

Commit

Permalink
Merge pull request #16 from blinkinput/release/v3.3.0
Browse files Browse the repository at this point in the history
Release/v3.3.0
  • Loading branch information
i1E authored May 23, 2017
2 parents 5f1edac + 46e2dfe commit 57515f4
Show file tree
Hide file tree
Showing 88 changed files with 3,202 additions and 743 deletions.
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputCombination/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId 'com.microblink.input'
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
}
lintOptions {
Expand Down
13 changes: 1 addition & 12 deletions BlinkInputDemo/BlinkInputCombination/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,4 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}


-keep class com.microblink.** { *; }

-keepclassmembers class com.microblink.** {
*;
}

-dontwarn android.hardware.**

-dontwarn android.support.v4.**
#}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
android:id="@+id/rec_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:animateRotation="true"
custom:animationDuration="250"
custom:initialOrientation="portrait" />
custom:mb_animateRotation="true"
custom:mb_animationDuration="250"
custom:mb_initialOrientation="portrait" />

<include layout="@layout/overlay_combination_blink_ocr" />

Expand Down
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputDetectorDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "com.microblink.input"
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand Down
10 changes: 0 additions & 10 deletions BlinkInputDemo/BlinkInputDetectorDemo/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

-keep class com.microblink.** { *; }

-keepclassmembers class com.microblink.** {
*;
}

-dontwarn android.hardware.**

-dontwarn android.support.v4.**
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import com.microblink.metadata.OcrMetadata;
import com.microblink.recognition.InvalidLicenceKeyException;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.IResultHolder;
import com.microblink.recognizers.RecognitionResults;
import com.microblink.recognizers.settings.RecognitionSettings;
import com.microblink.results.date.DateResult;
import com.microblink.util.CameraPermissionManager;
import com.microblink.util.Log;
import com.microblink.view.CameraEventsListener;
Expand Down Expand Up @@ -241,8 +243,18 @@ public void onScanningDone(@Nullable RecognitionResults results) {
mRecognizerView.pauseScanning();
StringBuilder sb = new StringBuilder();

for (String s : result.getResultHolder().keySet()) {
sb.append(s).append(": ").append(result.getStringElement(s)).append('\n');
IResultHolder resultHolder = result.getResultHolder();
for (String key : resultHolder.keySet()) {
Object value = resultHolder.getObject(key);
String stringValue = null;
if (value instanceof String) {
stringValue = (String) value;
} else if (value instanceof DateResult) {
stringValue = ((DateResult) value).getOriginalDateString();
}
if (stringValue != null && !stringValue.isEmpty()) {
sb.append(key).append(": ").append(stringValue).append('\n');
}
}

AlertDialog.Builder ab = new AlertDialog.Builder(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:id="@+id/recognizerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:initialOrientation="portrait">
custom:mb_initialOrientation="portrait">

</com.microblink.view.recognition.RecognizerView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
android:id="@+id/rec_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:animateRotation="true"
custom:animationDuration="250"
custom:initialOrientation="portrait">
custom:mb_animateRotation="true"
custom:mb_animationDuration="250"
custom:mb_initialOrientation="portrait">


</com.microblink.view.recognition.RecognizerView>
Expand Down
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputDirectAPI/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId 'com.microblink.input'
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
}
lintOptions {
Expand Down
13 changes: 1 addition & 12 deletions BlinkInputDemo/BlinkInputDirectAPI/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,4 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}


-keep class com.microblink.** { *; }

-keepclassmembers class com.microblink.** {
*;
}

-dontwarn android.hardware.**

-dontwarn android.support.v4.**
#}
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputFullScreen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId 'com.microblink.input'
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
}
lintOptions {
Expand Down
13 changes: 1 addition & 12 deletions BlinkInputDemo/BlinkInputFullScreen/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,4 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}


-keep class com.microblink.** { *; }

-keepclassmembers class com.microblink.** {
*;
}

-dontwarn android.hardware.**

-dontwarn android.support.v4.**
#}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:id="@+id/recognizerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:initialOrientation="portrait">
custom:mb_initialOrientation="portrait">

</com.microblink.view.recognition.RecognizerView>

Expand Down
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputRandomScanDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "com.microblink.input"
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
}

Expand Down
2 changes: 1 addition & 1 deletion BlinkInputDemo/BlinkInputSegmentDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId 'com.microblink.input'
minSdkVersion 10
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
}
lintOptions {
Expand Down
13 changes: 1 addition & 12 deletions BlinkInputDemo/BlinkInputSegmentDemo/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,4 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}


-keep class com.microblink.** { *; }

-keepclassmembers class com.microblink.** {
*;
}

-dontwarn android.hardware.**

-dontwarn android.support.v4.**
#}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class MainActivity extends Activity {
private static final int BLINK_OCR_VIN_REQUEST_CODE = 101;
private static final String NAME_VIN = "VIN";

private static final int BLINK_OCR_MOBILE_COUPON_REQUEST_CODE = 102;
private static final String NAME_MOBILE_COUPON = "MobileCoupon";
private static final int BLINK_OCR_TOPUP_REQUEST_CODE = 102;
private static final String NAME_TOPUP = "TopUp";

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -135,9 +135,9 @@ public void regexExample(View v) {
}

/**
* Called as handler for "Mobile coupons example" button
* Called as handler for "TopUp example" button
*/
public void mobileCouponsExample(View view) {
public void topUpExample(View view) {
/*
* In this simple example we will use BlinkInput SDK to create a simple app
* that scans prepaid mobile coupon codes.
Expand All @@ -147,10 +147,10 @@ public void mobileCouponsExample(View view) {
// license key is required for recognizer to work.
intent.putExtra(SegmentScanActivity.EXTRAS_LICENSE_KEY, LICENSE_KEY);

// create settings for mobile coupon parser, find codes with prefix "*123*"
// create settings for top up parser, find codes with prefix "*123*"
TopUpParserSettings topUpParserSett = new TopUpParserSettings(TopUpParserSettings.TopUpPrefix.TOP_UP_PREFIX_123);
// it is possible to create parser settings with given prefix and USSD length for codes in form *prefixString*USSDCodeLength_digits#
// MobileCouponsParserSettings topUpParserSett = new MobileCouponsParserSettings("01", 14);
// TopUpParserSettings topUpParserSett = new TopUpParserSettings("01", 14);

// allow codes without prefix, but prefix "*123*" will be added (we defined prefix in parser settings constructor)
topUpParserSett.setAllowNoPrefix(true);
Expand All @@ -160,7 +160,7 @@ public void mobileCouponsExample(View view) {
// each scan configuration contains two string resource IDs: string shown in title bar and string shown
// in text field above scan box. Besides that, it contains name of the result and settings object
// which defines what will be scanned.
new ScanConfiguration(R.string.mobile_coupon_title, R.string.mobile_coupon_msg, NAME_MOBILE_COUPON, topUpParserSett)
new ScanConfiguration(R.string.topup_title, R.string.topup_msg, NAME_TOPUP, topUpParserSett)
};

intent.putExtra(SegmentScanActivity.EXTRAS_SCAN_CONFIGURATION, conf);
Expand All @@ -172,7 +172,7 @@ public void mobileCouponsExample(View view) {

// once intent is prepared, we start the SegmentScanActivity which will preform scan and return results
// by calling onActivityResult
startActivityForResult(intent, BLINK_OCR_MOBILE_COUPON_REQUEST_CODE);
startActivityForResult(intent, BLINK_OCR_TOPUP_REQUEST_CODE);
}

/**
Expand All @@ -198,9 +198,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String vin = result.getString(NAME_VIN);
Toast.makeText(this, "Vehicle identification number is: " + vin, Toast.LENGTH_LONG).show();
break;
case BLINK_OCR_MOBILE_COUPON_REQUEST_CODE:
String mobileCouponCode = result.getString(NAME_MOBILE_COUPON);
Toast.makeText(this, "Mobile coupon code is: " + mobileCouponCode, Toast.LENGTH_LONG).show();
case BLINK_OCR_TOPUP_REQUEST_CODE:
String topUpCode = result.getString(NAME_TOPUP);
Toast.makeText(this, "TopUp code is: " + topUpCode, Toast.LENGTH_LONG).show();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
android:text="Regex parser example"/>

<Button
android:id="@+id/btnMobileCoupons"
android:id="@+id/btnTopUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:onClick="mobileCouponsExample"
android:text="Mobile coupons example"/>
android:onClick="topUpExample"
android:text="TopUp example"/>

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
android:id="@+id/rec_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:animateRotation="true"
custom:animationDuration="250"
custom:initialOrientation="portrait" />
custom:mb_animateRotation="true"
custom:mb_animationDuration="250"
custom:mb_initialOrientation="portrait" />

<include layout="@layout/overlay" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<string name="vin_title">VIN</string>
<string name="vin_msg">Position VIN in this frame</string>

<string name="mobile_coupon_title">Mobile coupon code</string>
<string name="mobile_coupon_msg">Position mobile coupon code in this frame</string>
<string name="topup_title">TopUp</string>
<string name="topup_msg">Position TopUp code in this frame</string>

<string name="help_msg_01">Place mobile phone above element that should be scanned and center it inside scanning frame.</string>
<string name="help_msg_02">When scanning is done you can edit data by tapping it.</string>
Expand Down
4 changes: 2 additions & 2 deletions BlinkInputDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.2'
}
}

Expand All @@ -19,7 +19,7 @@ allprojects {
// versions of libraries that all modules require

project.ext {
blinkInputVersion = '3.2.0'
blinkInputVersion = '3.3.0'
compileSdkVersion = 25
targetSdkVersion = 25
buildToolsVersion = '25.0.2'
Expand Down
4 changes: 2 additions & 2 deletions BlinkInputDemo/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Aug 30 13:22:05 CEST 2016
#Mon May 22 14:54:50 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Binary file modified LibBlinkInput-javadoc.jar
Binary file not shown.
Binary file modified LibBlinkInput.aar
Binary file not shown.
Loading

0 comments on commit 57515f4

Please sign in to comment.