Skip to content

Commit f391c49

Browse files
authored
Release 24.4 (#37)
* Use api.scanBarcode * Version 24.4.0
1 parent 4d870c2 commit f391c49

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ implementation fileTree(dir: "libs", include: ["*.jar"])
4141
implementation 'androidx.core:core-ktx:1.9.0'
4242
implementation 'androidx.appcompat:appcompat:1.6.0'
4343
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
44-
implementation 'com.aspose:aspose-barcode-cloud:24.3.0'
44+
implementation 'com.aspose:aspose-barcode-cloud:24.4.0'
4545
implementation 'com.google.android.material:material:1.8.0'
4646
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
4747
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

app/src/main/java/com/aspose/barcode/cloud/demo_app/MainActivity.kt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ import androidx.core.content.ContextCompat
4747
import com.aspose.barcode.cloud.ApiClient
4848
import com.aspose.barcode.cloud.ApiException
4949
import com.aspose.barcode.cloud.api.BarcodeApi
50+
import com.aspose.barcode.cloud.model.CodeLocation
5051
import com.aspose.barcode.cloud.model.EncodeBarcodeType
51-
import com.aspose.barcode.cloud.model.PresetType
5252
import com.aspose.barcode.cloud.requests.GetBarcodeGenerateRequest
53-
import com.aspose.barcode.cloud.requests.PostBarcodeRecognizeFromUrlOrContentRequest
53+
import com.aspose.barcode.cloud.requests.ScanBarcodeRequest
5454
import com.google.android.material.snackbar.Snackbar
5555
import java.io.File
5656
import java.io.FileOutputStream
@@ -197,8 +197,8 @@ class MainActivity : AppCompatActivity() {
197197
if (resultCode == RESULT_OK) {
198198
val bmpImage = data?.extras?.get("data") as Bitmap
199199
recognizeBarcode(bmpImage)
200-
}
201200
}
201+
}
202202

203203
else -> {
204204
showErrorMessage("No file selected")
@@ -220,12 +220,11 @@ class MainActivity : AppCompatActivity() {
220220
smallerBmp.compress(Bitmap.CompressFormat.PNG, 100, output)
221221
}
222222

223-
val recognizeRequest = PostBarcodeRecognizeFromUrlOrContentRequest()
224-
recognizeRequest.preset = PresetType.HIGHPERFORMANCE.value
225-
recognizeRequest.image = tmpFile
223+
val apiRequest = ScanBarcodeRequest(tmpFile);
224+
226225
Thread {
227226
try {
228-
val recognized = api.postBarcodeRecognizeFromUrlOrContent(recognizeRequest)
227+
val recognized = api.scanBarcode(apiRequest)
229228

230229
runOnUiThread {
231230
stopRecognizeAnimation()
@@ -278,6 +277,7 @@ class MainActivity : AppCompatActivity() {
278277
barcodeRequest.imageHeight = barcodeImgView.measuredHeight.toDouble()
279278
barcodeRequest.imageWidth = barcodeImgView.measuredWidth.toDouble()
280279
barcodeRequest.format = "png"
280+
281281
Thread {
282282
try {
283283
val generated: File? = api.getBarcodeGenerate(barcodeRequest)
@@ -318,7 +318,10 @@ class MainActivity : AppCompatActivity() {
318318
getContentIntent.type = "image/*"
319319
getContentIntent.addCategory(Intent.CATEGORY_OPENABLE)
320320
try {
321-
startActivityForResult(Intent.createChooser(getContentIntent, "Select an Image to Recognize"), ACTION_GET_CONTENT_CALLBACK_CODE)
321+
startActivityForResult(
322+
Intent.createChooser(getContentIntent, "Select an Image to Recognize"),
323+
ACTION_GET_CONTENT_CALLBACK_CODE
324+
)
322325
} catch (ex: java.lang.Exception) {
323326
showErrorMessage("Unable to start file selector")
324327
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<resources>
2-
<string name="app_name">Aspose Barcode Cloud</string>
2+
<string name="app_name">Aspose Barcode Cloud demo</string>
33
<string name="barcode">Barcode</string>
44
<string name="barcode_type">Barcode type to generate</string>
55
<string name="default_barcode_text">Barcode text</string>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.2.0' apply false
4-
id 'com.android.library' version '8.2.0' apply false
3+
id 'com.android.application' version '8.3.2' apply false
4+
id 'com.android.library' version '8.3.2' apply false
55
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
66
}
77
ext.kotlin_version = '1.7.21'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Jan 27 19:13:42 YEKT 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)