Skip to content

Commit

Permalink
Release 23.1 (#19)
Browse files Browse the repository at this point in the history
* Update base project for demo_app

Update dependencies

* Fix getting images for recognition

* Cleanup manifest

* Update version to 23.1

* Add blog.aspose.cloud to good url

* Gitignore cleanup

---------
Co-authored-by: Denis Averin <denis.averin@aspose.com>
  • Loading branch information
ivankamkin committed Jan 31, 2023
1 parent 7cc1e1c commit 6723e04
Show file tree
Hide file tree
Showing 17 changed files with 411 additions and 66 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# macOS
.DS_Store

# Built application files
*.apk
*.ap_
Expand Down Expand Up @@ -33,6 +36,7 @@ proguard/
captures/

# Intellij
.idea/
*.iml

# Keystore files
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Aspose Pty Ltd
Copyright (c) 2023 Aspose Pty Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed und
| [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-php) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) |[GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go)|
| [NuGet](https://www.nuget.org/packages/Aspose.barcode-Cloud/) | [Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-barcode-cloud) | [Composer](https://packagist.org/packages/aspose/barcode-cloud-php) | [PIP](https://pypi.org/project/aspose-barcode-cloud/) | [NPM](https://www.npmjs.com/package/aspose-barcode-cloud-node) | [Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-barcode-cloud) |[Go.Dev](https://pkg.go.dev/github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/) |

[Product Page](https://products.aspose.cloud/barcode/) | [Documentation](https://docs.aspose.cloud/display/barcodecloud/Home) | [API Reference](https://apireference.aspose.cloud/barcode/) | [Code Samples](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) | [Blog](https://blog.aspose.cloud/category/barcode/) | [Free Support](https://forum.aspose.cloud/c/barcode) | [Free Trial](https://dashboard.aspose.cloud/#/apps)
[Product Page](https://products.aspose.cloud/barcode/) | [Documentation](https://docs.aspose.cloud/display/barcodecloud/Home) | [API Reference](https://apireference.aspose.cloud/barcode/) | [Code Samples](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) | [Blog](https://blog.aspose.cloud/categories/aspose.barcode-cloud-product-family/) | [Free Support](https://forum.aspose.cloud/c/barcode) | [Free Trial](https://dashboard.aspose.cloud/#/apps)
47 changes: 28 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
namespace 'com.aspose.barcode.cloud.demo_app'
compileSdk 33

defaultConfig {
applicationId "com.example.asposebarcodecloud"
minSdkVersion 23
targetSdkVersion 30
applicationId "com.aspose.barcode.cloud.demo_app"
minSdk 23
targetSdk 33
versionCode 1
versionName "1.0"

Expand All @@ -22,21 +23,29 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}

repositories {
maven { url 'https://repository.aspose.cloud/repo/' }
buildFeatures {
viewBinding true
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.aspose:aspose-barcode-cloud:22.8.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.aspose:aspose-barcode-cloud:23.1.0'
implementation 'com.google.android.material:material:1.8.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
25 changes: 18 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.asposebarcodecloud">
package="com.aspose.barcode.cloud.demo_app">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<queries>
<!-- Camera -->
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>

<!-- Gallery -->
<intent>
<action android:name="android.intent.action.GET_CONTENT" />
</intent>
</queries>

<application
android:allowBackup="true"
Expand All @@ -17,7 +27,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -26,4 +37,4 @@
</activity>
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* --------------------------------------------------------------------------------
* <copyright company="Aspose">
* Copyright (c) 2022 Aspose.BarCode for Cloud
* Copyright (c) 2023 Aspose.BarCode for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -25,7 +25,7 @@
* --------------------------------------------------------------------------------
*/

package com.example.asposebarcodecloud
package com.aspose.barcode.cloud.demo_app

import android.Manifest
import android.app.Activity
Expand Down Expand Up @@ -56,6 +56,7 @@ import java.io.File
import java.io.FileOutputStream
import kotlin.math.floor


class MainActivity : AppCompatActivity() {
companion object {
const val PERMISSION_REQUEST_CALLBACK_CODE = 1
Expand Down Expand Up @@ -150,11 +151,12 @@ class MainActivity : AppCompatActivity() {
requestCode: Int,
permissions: Array<String>, grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
when (requestCode) {
PERMISSION_REQUEST_CALLBACK_CODE -> {
// If request is cancelled, the result arrays are empty.
if ((grantResults.isNotEmpty() &&
grantResults[0] == PackageManager.PERMISSION_GRANTED)
grantResults[0] == PackageManager.PERMISSION_GRANTED)
) {
// Permission is granted. Continue the action or workflow
// in your app.
Expand All @@ -178,6 +180,7 @@ class MainActivity : AppCompatActivity() {
}
}


override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

Expand All @@ -194,15 +197,16 @@ class MainActivity : AppCompatActivity() {
if (resultCode == RESULT_OK) {
val bmpImage = data?.extras?.get("data") as Bitmap
recognizeBarcode(bmpImage)
}
}
}

else -> {
showErrorMessage("No file selected")
}
}
}


private fun recognizeBarcode(image: Bitmap) {
try {
val smallerBmp = reduceBitmapSize(image)
Expand Down Expand Up @@ -312,8 +316,12 @@ class MainActivity : AppCompatActivity() {
private fun pickFile() {
val getContentIntent = Intent(Intent.ACTION_GET_CONTENT)
getContentIntent.type = "image/*"
if (getContentIntent.resolveActivity(packageManager) != null) {
startActivityForResult(getContentIntent, ACTION_GET_CONTENT_CALLBACK_CODE)
getContentIntent.addCategory(Intent.CATEGORY_OPENABLE)
try {
startActivityForResult(Intent.createChooser(getContentIntent, "Select an Image to Recognize"), ACTION_GET_CONTENT_CALLBACK_CODE)
} catch (ex: java.lang.Exception) {
showErrorMessage("Unable to start file selector")
}

}
}
6 changes: 6 additions & 0 deletions app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
13 changes: 13 additions & 0 deletions app/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
19 changes: 19 additions & 0 deletions app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
29 changes: 5 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.31'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
}
ext.kotlin_version = '1.7.21'
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 27 23:14:34 GMT+07:00 2020
#Fri Jan 27 19:13:42 YEKT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 6723e04

Please sign in to comment.