-
Notifications
You must be signed in to change notification settings - Fork 48
[SB-20828] cleanup examples #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: android_ds_9.0.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Scanbot SDK Classic Components examples | ||
|
|
||
| This project contains multiple standalone Android app modules demonstrating the Scanbot SDK Classic Components. Each module can be opened and run on its own. The only shared code lives in the `common` module. | ||
|
|
||
| ## How to run a module | ||
|
|
||
| 1. Open `scanbot-sdk-example-android/classic-components-example` in Android Studio. | ||
| 2. Sync Gradle. | ||
| 3. Choose one module in the **Run** configuration (each module is an `application`). | ||
| 4. Add your Scanbot SDK license key in the module’s `ExampleApplication` or stay on demo mode. | ||
| 5. Run the app on a device or emulator. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,8 +22,8 @@ import kotlinx.coroutines.Dispatchers | |
| import kotlinx.coroutines.launch | ||
| import kotlinx.coroutines.withContext | ||
| /** | ||
| Ths example uses new sdk APIs presented in Scanbot SDK v.8.x.x | ||
| Please, check the official documentation for more details: | ||
| This example uses the SDK APIs introduced in Scanbot SDK v8.x.x. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd leave just one (the latter one) "SDK" abbreviation mention There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... and the same comment in all other places like this |
||
| Please check the official documentation for more details: | ||
| Result API https://docs.scanbot.io/android/document-scanner-sdk/detailed-setup-guide/result-api/ | ||
| ImageRef API https://docs.scanbot.io/android/document-scanner-sdk/detailed-setup-guide/image-ref-api/ | ||
| */ | ||
|
|
@@ -105,9 +105,16 @@ class MainActivity : AppCompatActivity() { | |
|
|
||
| private suspend fun createAndScanDocumentPage(imageUri: Uri): String? { | ||
| val imageRef = withContext(Dispatchers.IO) { | ||
| val inputStream = contentResolver.openInputStream(imageUri) | ||
| ?: throw Exception("Cannot open input stream from URI") | ||
| ImageRef.fromInputStream(inputStream) | ||
| contentResolver.openInputStream(imageUri)?.use { inputStream -> | ||
| ImageRef.fromInputStream(inputStream) | ||
| } | ||
| } | ||
| if (imageRef == null) { | ||
| withContext(Dispatchers.Main) { | ||
| Log.e(Const.LOG_TAG, "Cannot open input stream from URI: $imageUri") | ||
| showToast("Error opening selected image!") | ||
| } | ||
| return null | ||
| } | ||
|
|
||
| val sdk = ScanbotSDK(this) | ||
|
|
||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the first "SDK" mention - it is clear that the API is from Scanbot SDK because it already says that in the second part of the sentence.
This example uses the APIs introduced in Scanbot SDK v8.x.x.