Skip to content

Commit

Permalink
added v11.4.14
Browse files Browse the repository at this point in the history
  • Loading branch information
sMaltsevAcuant committed Aug 3, 2021
1 parent 5edb7af commit 3ab76ac
Show file tree
Hide file tree
Showing 41 changed files with 2,792 additions and 201 deletions.
117 changes: 65 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Acuant Android SDK v11.4.13
**May 2021**
# Acuant Android SDK v11.4.14
**August 2021**

See [https://github.com/Acuant/AndroidSDKV11/releases](https://github.com/Acuant/AndroidSDKV11/releases) for release notes.

Expand All @@ -22,10 +22,6 @@ This document provides detailed information about the Acuant Android SDK. The Ac

## Updates

**As of April 29th 2021** Due to the upcoming end of service for Bintray the SDK is now distributed through a new Maven URL:

maven { url 'https://raw.githubusercontent.com/Acuant/AndroidSdkMaven/main/maven/' }

**v11.4.4:** Please review [Migration Details](docs/MigrationDetails.md) for migration details (last updated for v11.4.4).

----------
Expand All @@ -44,7 +40,7 @@ In order to maintain backward compatibility, the Acuant SDK is currently not com

## Prerequisites ##

- Supports Android SDK versions 21-29
- Supports Android SDK versions 21-30


## Modules ##
Expand Down Expand Up @@ -188,23 +184,23 @@ The SDK includes the following modules:

- Add the following Maven URL

maven { url 'https://raw.githubusercontent.com/Acuant/AndroidSdkMaven/main/maven/' }
maven { url 'https://dl.bintray.com/acuant/Acuant' }
maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' }
- Add the following dependencies

implementation 'com.acuant:acuantcommon:11.4.13'
implementation 'com.acuant:acuantcamera:11.4.13'
implementation 'com.acuant:acuantimagepreparation:11.4.13'
implementation 'com.acuant:acuantdocumentprocessing:11.4.13'
implementation 'com.acuant:acuantechipreader:11.4.13'
implementation 'com.acuant:acuantfacematch:11.4.13'
implementation 'com.acuant:acuanthgliveness:11.4.13'
implementation ('com.acuant:acuantipliveness:11.4.13'){
implementation 'com.acuant:acuantcommon:11.4.14'
implementation 'com.acuant:acuantcamera:11.4.14'
implementation 'com.acuant:acuantimagepreparation:11.4.14'
implementation 'com.acuant:acuantdocumentprocessing:11.4.14'
implementation 'com.acuant:acuantechipreader:11.4.14'
implementation 'com.acuant:acuantfacematch:11.4.14'
implementation 'com.acuant:acuanthgliveness:11.4.14'
implementation ('com.acuant:acuantipliveness:11.4.14'){
transitive = true
}
implementation 'com.acuant:acuantfacecapture:11.4.13'
implementation 'com.acuant:acuantpassiveliveness:11.4.13'
implementation 'com.acuant:acuantfacecapture:11.4.14'
implementation 'com.acuant:acuantpassiveliveness:11.4.14'

- Acuant also relies on Google Play services dependencies, which are pre-installed on almost all Android devices.

Expand Down Expand Up @@ -343,27 +339,20 @@ Here is the interface for the initialize listener:

1. Start camera activity:

val cameraIntent = Intent(this, AcuantCameraActivity::class.java)

cameraIntent.putExtra(ACUANT_EXTRA_IS_AUTO_CAPTURE, boolean)//default is true
cameraIntent.putExtra(ACUANT_EXTRA_BORDER_ENABLED, boolean)//default is true

startActivityForResult(cameraIntent, REQUEST_CODE)
Alternatively use the new options object. This method allows you to configure much more about the camera (see **AcuantCameraOptions**):
val cameraIntent = Intent(this, AcuantCameraActivity::class.java)
val cameraIntent = Intent(
this@MainActivity,
AcuantCameraActivity::class.java
)

cameraIntent.putExtra(ACUANT_EXTRA_CAMERA_OPTIONS,
AcuantCameraOptions
.DocumentCameraOptionsBuilder()
/*Call any other methods detailed in the AcuantCameraOptions section near the bottom of the readme*/
.build()
/*Acuant has temporarily kept the constructor public for backward compatibility,
* but it will become private in the near future. Acuant strongly recommends that
* you use the provided builder for all new implementations.*/
)

startActivityForResult(cameraIntent, REQUEST_CODE)
**Note:** When the camera is launched, the image processing speed is automatically checked.

* Live document detection and auto capture features are enabled if the device supports a speed of at least 130ms.
Expand All @@ -380,6 +369,38 @@ Here is the interface for the initialize listener:
}
}
### Capturing a document barcode ###

**Note:** During regular capture of a document the camera will try to read the barcode. You should only launch this camera mode if the barcode is expected according to document classification and failed to read during normal capture of the relevant side.

1. Start camera activity:

val cameraIntent = Intent(
this@MainActivity,
AcuantCameraActivity::class.java
)

cameraIntent.putExtra(ACUANT_EXTRA_CAMERA_OPTIONS,
AcuantCameraOptions
.BarcodeCameraOptionsBuilder()
/*Call any other methods detailed in the AcuantCameraOptions section near the bottom of the readme*/
.build()
)

startActivityForResult(cameraIntent, REQUEST_CODE)
1. Get activity result:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE && AcuantCameraActivity.RESULT_SUCCESS_CODE) {
val capturedBarcodeString = data?.getStringExtra(ACUANT_EXTRA_PDF417_BARCODE)
}
}

**Note:** This camera is completely reliant on Google Vision. If Google Services are unavailable, the camera will not launch and onActivityResult will instantly be called along with a null value for the barcode. To keep your workflow neater, we recommend checking for Google Services before launching the camera.

### Capturing MRZ data in a passport document ###

**Note:** To use the MRZ features, your credentials must be enabled to use Ozone.
Expand All @@ -404,9 +425,8 @@ Here is the interface for the initialize listener:
cameraIntent.putExtra(ACUANT_EXTRA_CAMERA_OPTIONS,
AcuantCameraOptions
.MrzCameraOptionsBuilder()
/*Call any other methods detailed in the AcuantCameraOptions section near the bottom of the readme*/
.build()
/*Please note that this uses a different builder than the document camera.
* This is how the camera knows that it is being launched in MRZ mode.*/
)
startActivityForResult(cameraIntent, REQUEST_CODE)
Expand Down Expand Up @@ -633,7 +653,7 @@ This module is used to match two facial images:

Must include EchipInitializer() in initialization (See **Initializing the SDK**).

1. If you are using ProGuard, then you must add the the following to the configuration file (otherwise the echip read will fail at runtime):
1. If you are using ProGuard, then you must add the the following to the configuration file (otherwise the eChip read will fail at runtime):

-keep class org.bouncycastle.jcajce.provider.** {
<fields>;
Expand Down Expand Up @@ -838,25 +858,9 @@ Relevant Enums:

### AcuantCameraOptions ###

class AcuantCameraOptions constructor(
val timeInMsPerDigit: Int = 900,
val digitsToShow: Int = 2,
val allowBox : Boolean = true,
val autoCapture : Boolean = true,
val bracketLengthInHorizontal : Int = 155,
val bracketLengthInVertical : Int = 255,
val defaultBracketMarginWidth : Int = 160,
val defaultBracketMarginHeight : Int = 160,
val colorHold : Int = Color.YELLOW,
val colorCapturing : Int = Color.GREEN,
val colorBracketAlign : Int = Color.BLACK,
val colorBracketCloser : Int = Color.RED,
val colorBracketHold : Int = Color.YELLOW,
val colorBracketCapturing : Int = Color.GREEN,
val cardRatio : Float = 0.65f
)
class AcuantCameraOptions ()
**Note:** While the constructor has been left public for backwards compatibility purposes, we encourage everyone to instead update to one of the two Options Builders included with the class:
**Note:** The camera options should be built using one of the following builders. This will also tell the camera what capture mode to use (Document, MRZ, or Barcode):

class DocumentCameraOptionsBuilder {
fun setTimeInMsPerDigit(value: Int) : DocumentCameraOptionsBuilder
Expand Down Expand Up @@ -886,6 +890,14 @@ Relevant Enums:
fun setColorBracketCapturing(value: Int) : MrzCameraOptionsBuilder
fun build() : AcuantCameraOptions
}
class BarcodeCameraOptionsBuilder {
fun setTimeToWaitAfterDetection(value: Int) : BarcodeCameraOptionsBuilder
fun setTimeToWaitUntilTimeout(value: Int) : BarcodeCameraOptionsBuilder
fun setColorCapturing(value: Int) : BarcodeCameraOptionsBuilder
fun setColorAlign(value: Int) : BarcodeCameraOptionsBuilder
fun build() : AcuantCameraOptions
}

### FaceCaptureOptions ###

Expand All @@ -907,6 +919,7 @@ Relevant Enums:
public boolean isRetrying;
public boolean isHealthCard;
public AuthenticationSensitivity authenticationSensitivity;
public TamperSensitivity tamperSensitivity;
}

-------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions acuantcamera/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<activity
android:name="com.acuant.acuantcamera.camera.mrz.cameraone.MrzCaptureActivity"
android:screenOrientation="portrait" />

<activity
android:name="com.acuant.acuantcamera.camera.barcode.cameraone.BarcodeCaptureActivity"
android:screenOrientation="portrait" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ abstract class AcuantBaseCameraFragment : Fragment() {
enum class CameraState {Align, MoveCloser, Hold, Steady, Capturing, MrzNone, MrzAlign, MrzMoveCloser, MrzReposition, MrzTrying, MrzCapturing, NotInFrame}

private var captureImageReader: ImageReader? = null
protected var isProcessing = false
private var image: Image? = null
internal var options: AcuantCameraOptions? = null
internal var isAutoCapture = true
Expand All @@ -60,7 +59,7 @@ abstract class AcuantBaseCameraFragment : Fragment() {
protected lateinit var textView: TextView
protected lateinit var imageView: ImageView
protected lateinit var detectors: List<IAcuantDetector>
private val previewBoundThreshold = 10
protected var barcodeOnly = false
protected var pointXOffset = 0
protected var pointYOffset = 0
private lateinit var orientationListener: AcuantOrientationListener
Expand Down Expand Up @@ -219,7 +218,11 @@ abstract class AcuantBaseCameraFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
textView = view.findViewById(R.id.acu_display_text)
imageView = view.findViewById(R.id.acu_help_image)
orientationListener = AcuantOrientationListener(activity!!.applicationContext, WeakReference(textView), WeakReference(imageView))
orientationListener = if (!barcodeOnly) {
AcuantOrientationListener(activity!!.applicationContext, WeakReference(textView), WeakReference(imageView))
} else {
AcuantOrientationListener(activity!!.applicationContext, WeakReference(textView))
}

setOptions(options)
}
Expand Down Expand Up @@ -330,10 +333,9 @@ abstract class AcuantBaseCameraFragment : Fragment() {
try {
val image:Image? = it.acquireLatestImage()
if (image != null) {
if(this.isAutoCapture && !this.isProcessing && !this.isCapturing){
try{
this.isProcessing = true
AcuantDetectorWorker(detectors, image).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
if (!isCapturing) {
try {
AcuantDetectorWorker(detectors, image, isAutoCapture).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
}
catch(e:Exception){
e.printStackTrace()
Expand All @@ -356,8 +358,7 @@ abstract class AcuantBaseCameraFragment : Fragment() {
try {
val image:Image? = it.acquireLatestImage()
if (image != null) {
if (isCapturing){
this.isProcessing = true
if (isCapturing) {
this.isCapturing = false

val capturetype = if(isAutoCapture) "AUTO" else "TAP"
Expand Down
Loading

0 comments on commit 3ab76ac

Please sign in to comment.