Skip to content

Commit

Permalink
added v11.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoonacuant committed Jul 9, 2020
1 parent 6a7f26c commit 515bffb
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 36 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Acuant Android SDK v11.4.1
**June 2020**
# Acuant Android SDK v11.4.2
**July 2020**

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

Expand Down Expand Up @@ -163,18 +163,18 @@ The SDK includes the following modules:
- Add the following dependencies

implementation 'com.acuant:acuantcommon:11.4.1'
implementation 'com.acuant:acuantcamera:11.4.1'
implementation 'com.acuant:acuantimagepreparation:11.4.1'
implementation 'com.acuant:acuantdocumentprocessing:11.4.1'
implementation 'com.acuant:acuantechipreader:11.4.1'
implementation 'com.acuant:acuantfacematch:11.4.1'
implementation 'com.acuant:acuanthgliveness:11.4.1'
implementation ('com.acuant:acuantipliveness:11.4.1'){
implementation 'com.acuant:acuantcommon:11.4.2'
implementation 'com.acuant:acuantcamera:11.4.2'
implementation 'com.acuant:acuantimagepreparation:11.4.2'
implementation 'com.acuant:acuantdocumentprocessing:11.4.2'
implementation 'com.acuant:acuantechipreader:11.4.2'
implementation 'com.acuant:acuantfacematch:11.4.2'
implementation 'com.acuant:acuanthgliveness:11.4.2'
implementation ('com.acuant:acuantipliveness:11.4.2'){
transitive = true
}
implementation 'com.acuant:acuantfacecapture:11.4.1'
implementation 'com.acuant:acuantpassiveliveness:11.4.1'
implementation 'com.acuant:acuantfacecapture:11.4.2'
implementation 'com.acuant:acuantpassiveliveness:11.4.2'
- Acuant also relies on Google Play services dependencies, which are pre-installed on almost all Android devices.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ abstract class AcuantBaseCameraFragment : Fragment() {
}

override fun onCreateView(inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = inflater.inflate(R.layout.fragment_camera2_basic, container, false)

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -257,8 +257,8 @@ abstract class AcuantBaseCameraFragment : Fragment() {
}

override fun onRequestPermissionsResult(requestCode: Int,
permissions: Array<String>,
grantResults: IntArray) {
permissions: Array<String>,
grantResults: IntArray) {
if (requestCode == REQUEST_CAMERA_PERMISSION) {
if (grantResults.size != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
ErrorDialog.newInstance(getString(R.string.request_permission))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class AcuantDocCameraFragment : AcuantBaseCameraFragment(),
}

when {
croppedImage == null || croppedImage.dpi < MINIMUM_DPI -> {
croppedImage == null || croppedImage.dpi < MINIMUM_DPI -> {
unlockFocus()
rectangleView.setViewFromState(CameraState.Align)
setTextFromState(CameraState.Align)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,22 +857,36 @@ private static int getIdForRequestedCamera(int facing) {

private static SizePair selectSizePair(Camera camera, int desiredWidth, int desiredHeight) {
List<SizePair> validPreviewSizes = generateValidPreviewSizeList(camera);

// The method for selecting the best size is to minimize the sum of the differences between
// the desired values and the actual values for width and height. This is certainly not the
// only way to select the best size, but it provides a decent tradeoff between using the
// closest aspect ratio vs. using the closest pixel area.
SizePair selectedPair = null;
int maxArea = Integer.MIN_VALUE;
int maxPict = Integer.MIN_VALUE;
int area = Integer.MIN_VALUE;
for (SizePair sizePair : validPreviewSizes) {
Size size = sizePair.previewSize();
int area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
Size size_pict = sizePair.pictureSize();
int newArea = size_pict.getWidth()*size_pict.getHeight();
if (newArea > maxPict) {
maxPict = newArea;
maxArea = Integer.MIN_VALUE;
Size size = sizePair.previewSize();
area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
}
}
else if (newArea == maxPict) {
Size size = sizePair.previewSize();
area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
}
}
}

return selectedPair;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ class DocumentCaptureActivity : AppCompatActivity(), DocumentCameraSource.Pictur
val image = BitmapFactory.decodeByteArray(data, 0, data.size)

if((image.width > image.height && this.lastOrientation == ORIENTATION_LANDSCAPE_REVERSE) ||
(image.width < image.height && this.lastOrientation == ORIENTATION_LANDSCAPE)){
(image.width < image.height && this.lastOrientation == ORIENTATION_LANDSCAPE)){
val rotated = ImageSaver.rotateImage(image, 180f)
val stream = ByteArrayOutputStream()
rotated.compress(Bitmap.CompressFormat.JPEG, 100, stream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,22 +859,36 @@ private static int getIdForRequestedCamera(int facing) {

private static SizePair selectSizePair(Camera camera, int desiredWidth, int desiredHeight) {
List<SizePair> validPreviewSizes = generateValidPreviewSizeList(camera);

// The method for selecting the best size is to minimize the sum of the differences between
// the desired values and the actual values for width and height. This is certainly not the
// only way to select the best size, but it provides a decent tradeoff between using the
// closest aspect ratio vs. using the closest pixel area.
SizePair selectedPair = null;
int maxArea = Integer.MIN_VALUE;
int maxPict = Integer.MIN_VALUE;
int area = Integer.MIN_VALUE;
for (SizePair sizePair : validPreviewSizes) {
Size size = sizePair.previewSize();
int area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
Size size_pict = sizePair.pictureSize();
int newArea = size_pict.getWidth()*size_pict.getHeight();
if (newArea > maxPict) {
maxPict = newArea;
maxArea = Integer.MIN_VALUE;
Size size = sizePair.previewSize();
area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
}
}
else if (newArea == maxPict) {
Size size = sizePair.previewSize();
area = size.getWidth()*size.getHeight();
if (maxArea < area) {
selectedPair = sizePair;
maxArea = area;
}
}
}

return selectedPair;
}

Expand Down
Binary file modified acuantcommon/acuantcommon.aar
Binary file not shown.
Binary file modified acuantdocumentprocessing/acuantdocumentprocessing.aar
Binary file not shown.
Binary file modified acuantechipreader/acuantechipreader.aar
Binary file not shown.
Binary file modified acuantfacematch/acuantfacematch.aar
Binary file not shown.
Binary file modified acuantimagepreparation/acuantimagepreparation.aar
Binary file not shown.
Binary file modified acuantipliveness/acuantipliveness.aar
Binary file not shown.
Binary file modified acuantpassiveliveness/acuantpassiveliveness.aar
Binary file not shown.
4 changes: 3 additions & 1 deletion app/src/main/java/com/acuant/sampleapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,9 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemSelectedListener {
c.setRequestProperty("Authorization", basicAuth)
c.useCaches = false
c.connect()
return BitmapFactory.decodeStream(c.inputStream)
val img = BitmapFactory.decodeStream(c.inputStream)
c.disconnect()
return img
}
return null
}
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/java/com/acuant/sampleapp/NFCResultActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ class NfcResultActivity : AppCompatActivity() {
private fun setData(data: NfcData) {
var key = "Given name"
var value = data.firstName
var i = value.indexOf("<")
if (i > 0) {
value = value.substring(0, i)
}
addField(key, value)

key = "Surname"
value = data.lastName
val i = value.indexOf("<")
i = value.indexOf("<")
if (i > 0) {
value = value.substring(0, i)
}
Expand All @@ -108,7 +112,7 @@ class NfcResultActivity : AppCompatActivity() {
addField(key, value)

key = "Document type"
value = data.documentType.toString() + ""
value = data.documentType
addField(key, value)

key = "Issuing state"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ allprojects {
google()
jcenter()
}
version = '11.2.3'
version = '11.4.2'
group = 'com.acuant' // Maven Group ID for the artifact
}

Expand Down

0 comments on commit 515bffb

Please sign in to comment.