Compare commits

...

385 Commits

Author SHA1 Message Date
Ralf Kistner d09b7c76c3 Merge pull request #726 from yuchan2215/patch-1
Fix Typo
2022-10-21 10:40:04 +02:00
yuchan2215 3a2db7ffc6 Fix Typo 2022-10-21 12:04:14 +09:00
Ralf Kistner 2a65a6c973 Merge pull request #708 from amirrudd/patch-1
Remove duplicate in ReadMe
2022-06-16 15:14:09 +02:00
Amir Rudd 3c77f1d6c8 Remove duplicate in ReadMe 2022-06-16 15:24:55 +04:30
Ralf Kistner b6c6421dd5 Merge pull request #696 from saifkhichi96/patch-1
Added ability to customize colors in barcodes generated with BarcodeEncoder.
2022-02-21 09:58:04 +02:00
Muhammad Saif Ullah Khan 8173d4a8b2 Added color customization instructions in README 2022-02-08 18:27:41 +01:00
Muhammad Saif Ullah Khan 8fdbbbef5e Support custom colors in BarcodeEncoder.java. 2022-02-08 18:17:58 +01:00
Conrad Hofmeyr 2324a5403e Update README.md 2021-12-22 12:29:22 -07:00
Ralf Kistner c752130405 Merge pull request #673 from juliansteenbakker/make-initializeAttributes-public
imp: make initializeAttributes public
2021-11-17 10:32:59 +02:00
juliansteenbakker 1c27c8fe2d imp: make initializeAttributes public 2021-11-17 08:52:37 +01:00
Ralf Kistner aa129af542 Merge pull request #666 from journeyapps/update-readme-sdk-version
Update notes on minSdkVersion
2021-10-26 16:19:21 +02:00
Ralf Kistner 90b5db5fcd Update notes on minSdkVersion. 2021-10-26 10:49:40 +02:00
Ralf Kistner 24d02945fe Merge pull request #665 from journeyapps/fixes
v4.3.0
2021-10-25 15:54:10 +02:00
Ralf Kistner 6ccf3a9d1a Fix lint report location. 2021-10-25 15:46:32 +02:00
Ralf Kistner 23f29e5a56 Ignore lint error. 2021-10-25 15:41:21 +02:00
Ralf Kistner 1a8d949325 Tweaks. 2021-10-25 15:37:09 +02:00
Ralf Kistner f1554b7478 Use GitHub Actions. 2021-10-25 15:32:46 +02:00
Ralf Kistner cc12c103e0 v4.3.0 and cleanup. 2021-10-25 15:22:01 +02:00
Ralf Kistner a13ce2b161 Cleanup. 2021-10-25 15:06:58 +02:00
Ralf Kistner 0c97cf70cc ScanOptions and ScanContract. 2021-10-25 14:57:43 +02:00
Ralf Kistner 9beeac7960 minSdkVersion 19. Multidex and desugaring. 2021-10-25 13:53:35 +02:00
Ralf Kistner cc34502f13 Smaller libs. 2021-10-25 13:53:25 +02:00
Ralf Kistner 2221621de9 Some cleanup. 2021-10-25 13:03:59 +02:00
Ralf Kistner 4d4c5a2c4e Disable jetifier. 2021-10-25 13:03:51 +02:00
Ralf Kistner 65d2716c71 Upgrade tooling. 2021-10-25 13:01:17 +02:00
Ralf Kistner 7fd1ab8794 Fix lint issues. 2021-10-25 13:00:40 +02:00
Ralf Kistner 630e3cc0f8 Fix API 19 crash. 2021-10-25 13:00:19 +02:00
Ralf Kistner 40260272fc Merge pull request #617 from journeyapps/maven-central
Maven Central
2021-03-15 17:45:32 +02:00
Ralf Kistner f54615e43a Update metadata and scripts for Maven Central. 2021-03-15 11:18:34 +02:00
Ralf Kistner 1acc3a6f4f Merge pull request #605 from devzeze/devzeze-fix556
fix #556 add licenses to POM
2021-02-12 10:32:22 +02:00
Ralf Kistner 73093b9b4f Merge pull request #587 from ANewGalaxy/master
Fixing MediaPlayer warnings;
2021-02-12 10:30:32 +02:00
Ralf Kistner db85816b3d Merge pull request #609 from nodh/feature/preventclassclash
Move CameraConfigurationUtils to prevent clash with other ZXing libraries
2021-02-12 10:29:37 +02:00
Christian Kollmann 6a3d857019 Move CameraConfigurationUtils to prevent clash with com.google.zxing:android-core 2021-02-12 07:26:12 +01:00
devzeze 6c8ea7e3fd fix #556 2021-02-03 16:07:17 +01:00
ANewGalaxy 35ee545f8b Replaced setAudioStreamType method call with setAudioAttributes call to fix warnings about stream types. Also removed unused import. 2020-12-11 22:00:01 -05:00
ANewGalaxy 5d9e2c3756 Added reset calls before each release call 2020-12-11 21:57:36 -05:00
ANewGalaxy cce2a300ef Fixing MediaPlayer warnings; 2020-12-11 21:48:29 -05:00
Ralf Kistner 13440ad875 Update readme. 2020-02-11 09:55:51 +02:00
Ralf Kistner 5a2470f034 Merge branch 'master' of github.com:journeyapps/zxing-android-embedded 2020-02-11 09:52:51 +02:00
Ralf Kistner 545672bb8f Update README.md
Fix the version.
2020-01-31 17:24:51 +02:00
Ralf Kistner 542dc66090 Merge pull request #530 from lukassos/master
correct release version 4.0.2
2020-01-17 14:44:06 +02:00
Lukassos ea414a236e correct release version 4.0.2
After two days of headaches, looked into CHANGES.md where 4.0.0 is marked as broken - we should use 4.0.2
2020-01-17 12:14:32 +01:00
Ralf Kistner 1ba1ded540 Merge pull request #529 from hannesa2/ReduceTravisBuilds
Reduce Travis builds
2020-01-08 17:05:52 +02:00
Ralf Kistner 4893bcc194 Merge pull request #528 from hannesa2/AndroidStudio-3.5.3
Android Studio 3.5.3
2020-01-08 10:13:54 +02:00
Hannes Achleitner 6498fad6a7 Reduce Travis builds 2020-01-07 19:52:44 +01:00
Hannes Achleitner f7f779d7ac Android Studio 3.5.3 2020-01-07 19:49:36 +01:00
Ralf Kistner c555ffbe05 Release 4.1.0 2020-01-07 14:24:05 +02:00
Andre Ippisch e0d340952d Camera permission behaviour (#505)
* Remove unused else

* Remove SDK version check since we are on minimum 24 already

* Add intent key about missing camera permission

* Add boolean value to show error dialog

- always true for the beginning to keep current behaviour

* Make displaying an error dialog for missing camera permissions optional

* Add intent extras for Intent initialisation

* Initialise camera permission dialog visibility from Intent

* Add original intent to IntentResult

* Use original intent in IntentResult

* Make onRequestPermissionResult public again

* Forward onRequestPermissionResult

* React on Intent information

- for example on the missing camera permission

* Revert "Remove SDK version check since we are on minimum 24 already"

This reverts commit 8f79f56a

* Add missing imports
2020-01-07 14:00:51 +02:00
Ralf Kistner 9b924e6875 Merge pull request #511 from hannesa2/AndroidStudio-3.5.2
Android Studio 3.5.2
2020-01-07 13:55:48 +02:00
Ralf Kistner 8df0cb554a Merge pull request #527 from yands11/master
Apply space convention after 'if'
2020-01-07 13:54:55 +02:00
Ralf Kistner 09d992ddfa Merge pull request #519 from bekabot/master
Remove unneeded type casts & fix comment typo in DecoratedBarcodeView.java
2020-01-07 13:54:27 +02:00
Ralf Kistner 95cd4a3a4d Merge pull request #512 from hannesa2/SomeCodeCleanup
some code cleanup
2020-01-07 13:54:02 +02:00
youngseok 7e5bbd2997 Apply space convention after 'if' 2020-01-07 14:37:28 +09:00
bekabot 8d8cd7d445 remove unneeded type casts 2019-12-10 13:40:43 +06:00
bekabot bd857c68eb fix comment 2019-12-10 13:35:13 +06:00
Hannes Achleitner 0fdfbce9fb some code cleanup 2019-11-17 13:49:59 +01:00
Hannes Achleitner eba457ee9e Android Studio 3.5.2 2019-11-17 13:42:27 +01:00
Ralf Kistner 9319110de8 Merge pull request #504 from anipp100/default-method
Use default annotation for optional interface method
2019-10-24 09:33:31 +02:00
Ralf Kistner ee4b181f23 Merge pull request #506 from anipp100/lambda-runnable
Use lambda for standalone Runnables
2019-10-24 09:33:12 +02:00
Ralf Kistner a4f751500c Fix instructions for min-sdk 14.
Fixes #507.
2019-10-22 10:05:01 +02:00
Andre Ippisch 75b4aa57f5 Use lambda for standalone Runnables 2019-10-18 14:39:58 +02:00
Andre Ippisch eb4cbd5095 Use default annotation for optional interface method 2019-10-18 12:48:47 +02:00
Andre Ippisch aa4fca5dae Let visibility of "laser scanner" be set (#503)
* Add laser visibility attribute

* Add laser visibility attribute usage to sample project

- set to true to stick with the current behavior
- included for didactic reasons

* Add laser visibility attribute to ViewfinderView and set it accordingly

* Draw "laser scanner" only if wanted

* Let laser visibility be changed programmatically

* Add sample code to show how laser visibility can be changed programmatically
2019-10-17 14:21:23 +02:00
Ralf Kistner d22b581cd3 Merge pull request #495 from journeyapps/release-401
Release v4.0.2
2019-09-07 19:04:30 +02:00
Ralf Kistner 9349b31ab3 v4.0.2. 2019-09-07 19:01:10 +02:00
Ralf Kistner c0c8363f85 More publishing fixes. 2019-09-07 19:00:32 +02:00
Ralf Kistner 27c22e8ffe v4.0.1 2019-09-07 18:53:01 +02:00
Ralf Kistner d77fa29226 Fix bintray publishing issues. 2019-09-07 18:51:44 +02:00
Ralf Kistner 9aa5381c2b Merge pull request #494 from journeyapps/upgrade-zxing
v4.0.0
2019-09-07 18:17:40 +02:00
Ralf Kistner 3a7612661a v4.0.0.; update docs. 2019-09-07 18:03:30 +02:00
Ralf Kistner 70f4bbb8de Merge pull request #493 from journeyapps/preview-sizing
Fix preview sizing & fix ResultPoints for front camera
2019-09-07 17:57:56 +02:00
Ralf Kistner 363ad77540 Upgrade zxing; min sdk of 24. 2019-09-07 17:52:00 +02:00
Ralf Kistner 62547c10d7 Internal support for downscaling before decoding.
Fix ResultPoint transformation for mirrored camera.
2019-09-07 17:43:08 +02:00
Ralf Kistner 0de49aa7c8 Check scaled preview size even earlier. 2019-09-07 15:49:52 +02:00
Ralf Kistner 1a1c8d0e66 Merge pull request #463 from lterminiello/fixArithmeticException
fix ArithmeticException in CameraPreview
2019-09-07 15:45:25 +02:00
Ralf Kistner 31332404fc Merge pull request #492 from journeyapps/upgrade
Upgrade tooling
2019-09-07 15:35:48 +02:00
Ralf Kistner 28c646b9e2 Merge pull request #469 from adrianoluis/more-extras-array
Adds support to send Arrays as more extras.
2019-09-07 15:35:33 +02:00
Ralf Kistner c0c0fcd745 More tooling upgrades. 2019-09-07 15:28:29 +02:00
Ralf Kistner 98d00abcbd Remove sample-nosupport. 2019-09-07 15:28:18 +02:00
Ralf Kistner 7042d74f4a Merge pull request #438 from journeyapps/androidx
Switch to androidx
2019-09-07 15:12:11 +02:00
Adriano Rocha 94ae63d857 Adds support to send Arrays as more extras. 2019-04-01 22:18:04 -07:00
Lucas Marcelo Terminiello 0e7413e1f7 fix ArithmeticException in CameraPreview 2019-02-27 14:37:57 -03:00
Ralf Kistner 82e8f9afcc Switch to androidx. 2018-11-02 20:21:21 +02:00
Ralf Kistner 6556f81558 Merge branch 'akallabeth-about_library_support' 2018-11-02 20:17:58 +02:00
Ralf Kistner 5983e2fb8e Add AboutLibaries to the sample app. 2018-11-02 20:16:13 +02:00
Ralf Kistner be04a7587f Merge branch 'about_library_support' of https://github.com/akallabeth/zxing-android-embedded into akallabeth-about_library_support 2018-11-02 19:49:31 +02:00
Ralf Kistner 330cb2b63b Merge branch 'master' of github.com:journeyapps/zxing-android-embedded 2018-11-02 19:47:32 +02:00
Ralf Kistner 6b49e8774f Merge branch 'amadeu01-change-mask-color-programmatically' 2018-11-02 19:46:50 +02:00
Ralf Kistner 209e1c9a04 Remove redundant call; set random color on every launch in sample. 2018-11-02 19:46:24 +02:00
Ralf Kistner c7a143499e Merge branch 'change-mask-color-programmatically' of https://github.com/amadeu01/zxing-android-embedded into amadeu01-change-mask-color-programmatically 2018-11-02 19:42:19 +02:00
Ralf Kistner a4dfc2fca4 Merge pull request #406 from reusch/feature/torch-at-startup
Torch at camera startup
2018-11-02 19:39:56 +02:00
Ralf Kistner 98b69af339 Merge pull request #412 from greatjack1/master
changed compile to implementation in README.md
2018-11-02 19:39:03 +02:00
Ralf Kistner 40010a62df Merge pull request #383 from CaramelHeaven/feature/update_sample
Updated sample
2018-11-02 19:38:39 +02:00
Ralf Kistner 5927f38a1d Merge branch 'MicroSpecWes-master' 2018-11-02 19:37:24 +02:00
Ralf Kistner f2a477b647 More updates and fixes. 2018-11-02 19:37:12 +02:00
Amadeu Cavalcante 65aaa93a27 Added support for programmatically change ViewfinderView mask color 2018-10-15 21:24:58 -03:00
Armin Novak 1e1b075f13 Added resource strings for AboutLibraries 2018-08-13 13:57:06 +02:00
greatjack1 224bfd6ea2 changed compile to implementation in README.md 2018-07-16 14:58:28 -04:00
Thomas Reusch c1a3786c17 torch at camera startup
add option to enable the torch at camera startup when using IntentIntegrator
2018-06-17 21:56:24 +02:00
Wesley Crick 2af07f95cf Gradle Update and SDK 27
Updated android support dependencies to 27.1.1.

Update deprecated "compile" to "implementation".
2018-05-30 16:35:42 -04:00
CaramelHeaven 4e7ee70b73 Updated sample 2018-03-30 23:11:59 +04:00
Ralf Kistner aec45c4f10 Add note on hardware acceleration.
Fixes #373.
2018-03-06 15:05:41 +02:00
Ralf Kistner c1918b32fb Fix and clarify Android SDK version notes. 2018-03-05 19:15:42 +02:00
Ralf Kistner a2774c7bde Use newer bintray plugin. 2018-03-04 14:20:58 +02:00
Ralf Kistner 2f061a1da5 zxing:core 3.3.2; notes on downgrading; bump to 3.6.0. 2018-03-04 14:10:44 +02:00
Ralf Kistner 70f4159e3a Include more licenses for Travis. 2018-03-04 13:55:54 +02:00
Ralf Kistner 295193d613 Add notes on threading. 2018-03-04 13:40:32 +02:00
Ralf Kistner d8f3157e97 Make it easier to specify barcode formats. 2018-03-04 13:34:54 +02:00
Ralf Kistner a7d91dbed6 Cleanup. 2018-03-04 13:19:06 +02:00
Ralf Kistner e8257760da Merge pull request #327 from alpbak/master
Added a mixed scan mode to scan inverted and normal barcodes at the same time.
2018-03-04 13:14:00 +02:00
Ralf Kistner 2f022c0a70 Make requestCode non-static. 2018-03-04 13:05:59 +02:00
Ralf Kistner 3fd9354cd7 Merge branch 'master' of github.com:journeyapps/zxing-android-embedded 2018-03-04 12:53:53 +02:00
Ralf Kistner c98a04a407 Merge pull request #287 from tingbob/master
Redefine the default activity request code for using switch statement.
2018-03-04 12:53:43 +02:00
Ralf Kistner 8e90d15117 Merge pull request #328 from bossbossk20/master
add generate barcode example
2018-03-04 12:52:07 +02:00
Ralf Kistner fa2cd1562d Merge pull request #324 from HomerSp/master
Request the camera preview on the main ui thread
2018-03-04 12:50:50 +02:00
Ralf Kistner 11073ddcf9 Simplify code with new minimum SDK version. 2018-03-04 12:47:53 +02:00
Ralf Kistner 17ad61674e Update build tools. 2018-03-04 12:37:20 +02:00
Ralf Kistner 8a67d852e4 Fix some lint issues. 2018-03-04 12:29:04 +02:00
Ralf Kistner 68f17bde30 Merge pull request #313 from 84d010m08/Added_camera_setting_change
Added camera setting change.
2018-03-04 11:42:22 +02:00
Ralf Kistner 34788e0fbc Merge pull request #360 from matpag/update_zxing_core
Update zxing core to 3.3.1
2018-03-04 11:39:57 +02:00
Mattia Pagini 45756b51b2 Update zxing core to 3.3.1 2018-01-05 10:12:16 +01:00
thanawat adee48a8ae add generate barcode example 2017-09-16 01:59:50 +07:00
alpbak e48229ac3f Revert "Added a mixed scan mode to enable scanning inverted and normal barcodes"
This reverts commit cf4c0dce50.

# Conflicts:
#	sample/src/main/java/example/zxing/MainActivity.java
#	zxing-android-embedded/src/com/google/zxing/client/android/Intents.java
#	zxing-android-embedded/src/com/journeyapps/barcodescanner/DecoratedBarcodeView.java
#	zxing-android-embedded/src/com/journeyapps/barcodescanner/DefaultDecoderFactory.java
2017-09-15 10:03:10 +03:00
alpbak 2ff44f91b5 Revert "Added a mixed scan mode to enable scanning inverted and normal barcodes"
This reverts commit cf4c0dce50.
2017-09-15 09:45:19 +03:00
alpbak f30ea0c955 Added a mixed scan mode to enable scanning inverted and normal barcodes 2017-09-15 09:34:42 +03:00
alpbak cf4c0dce50 Added a mixed scan mode to enable scanning inverted and normal barcodes 2017-09-14 20:12:06 +03:00
HomerSp 670000698d Request the camera preview on the main thread, in case the camera instance is being closed at the same time. 2017-09-07 15:10:08 +02:00
橋度朋弥 60ed28ee06 Add to Javadoc. 2017-07-30 13:49:28 +09:00
橋度朋弥 c83b2c5a5c Added camera setting change. 2017-07-24 02:08:26 +09:00
Ralf Kistner eaeddd23af Merge pull request #290 from Palatis/alloc_in_ondraw_fix
Alloc in ondraw fix
2017-06-23 15:18:38 +02:00
Victor Tseng 0fd028b9e2 just don't add the result points when exceeding maximum
just don't add at the first place, instead of add and then trim.
2017-04-10 15:19:17 +08:00
Victor Tseng e2892cad8f don't allocate in ViewfinderView.onDraw()
don't alloc in onDraw() as indicated by lint, avoids GC.
we now draw lastPossibleResultPoints before possibleResultPoints,
however it doesn't really matter which one is drawn first, since current
ones are going to cover last ones anyway.
2017-04-10 15:17:38 +08:00
nlv 1817bb198b Redefine the default activity request code for using switch statement.
Add a construct function to set customized activity request code.
2017-04-01 16:57:11 +08:00
Ralf Kistner 29848b2b4f v3.5.0 2017-03-20 15:04:25 +02:00
Ralf Kistner 9ec92a5101 Add explicit check for null preview data.
Fixes #268.
2017-03-20 13:40:46 +02:00
Ralf Kistner 2cf4b60f0f Handle getParameters() failure in onPreviewFrame(). 2017-03-20 13:18:24 +02:00
Ralf Kistner e3aed41746 Add error handling for CameraManager#setTorch. 2017-03-20 13:12:31 +02:00
Ralf Kistner 09571d3813 Add tabbed scanner example. 2017-03-20 13:07:55 +02:00
Ralf Kistner 6c250faeb6 Close camera before finishing Activity. 2017-03-20 13:05:36 +02:00
Ralf Kistner 4955c18a87 Fix leak with scan timeout.
Fixes #283.
2017-03-20 10:32:08 +02:00
Ralf Kistner 6f73f470c9 Squashed commit of the following:
commit 01acef10132802b22e104c411122c2790673afdc
Author: Ralf Kistner <ralf@journeyapps.com>
Date:   Sun Mar 12 13:08:09 2017 +0200

    Try again.

commit 4c0605282d13df59c856fd64945d096d5789f227
Author: Ralf Kistner <ralf@journeyapps.com>
Date:   Sun Mar 12 13:01:58 2017 +0200

    Show lint output on build failure.

commit e9af0670c8b2e07a4bd2418042b0487e97fb9389
Author: Ralf Kistner <ralf@journeyapps.com>
Date:   Sun Mar 12 12:50:11 2017 +0200

    Handle missing local.properties file.

commit e3976102e7342d3008c7b88cb3f75397397e3d95
Author: Ralf Kistner <ralf@journeyapps.com>
Date:   Sun Mar 12 12:36:47 2017 +0200

    Update SDK components installed on Travis.

commit e50952cc89cc83720e146838debf6a22bb1d9c2a
Author: Ralf Kistner <ralf@journeyapps.com>
Date:   Sun Mar 12 12:28:18 2017 +0200

    More tool upgrades.

     * Gradle 3.4.1
     * Android Gra dle plugin 2.3.0
     * Remove android-sdk-manager (no longer required).
     * Ignore lint for translation issues in sample apps.
2017-03-12 13:14:17 +02:00
Ralf Kistner 5d48d2ff35 Merge branch 'PaulWoitaschek-master' 2017-03-12 11:58:17 +02:00
Paul Woitaschek 92f6acf3d6 Suppress cast warning and removed unused parameters 2017-01-14 09:57:46 +01:00
Paul Woitaschek 5309388c7a Build with jdk8 to resolve major-minor-version build issue 2017-01-14 09:48:49 +01:00
Paul Woitaschek b3a2c1e07e Dependencies updated. Most noteworthy: zxing:core 3.3.0 2017-01-14 08:29:21 +01:00
Ralf Kistner 958bbb1491 Add copyright notice to readme
Fixes #226.
2017-01-03 11:50:45 +02:00
Ralf Kistner 34aca80673 Merge pull request #244 from rocboronat/patch-1
Fix a typo in the Catalan translation
2016-11-28 10:26:11 +02:00
Roc Boronat 0b774fba7c Fix a typo in the Catalan translation 2016-11-26 18:08:44 +01:00
Ralf Kistner 81effea784 Merge pull request #235 from Mikejleighton/master
Added support for an inverted scan
2016-11-04 09:16:32 +02:00
Ralf Kistner b4a88bfb56 Merge pull request #234 from renatosc/master
allowing change of REQUEST_CODE value
2016-11-04 09:14:57 +02:00
Leighton, Michael 6c3e917b15 Adding an InvertedDecoder 2016-11-02 22:39:43 -04:00
Leighton, Michael f484d21af8 Added support for inverted scans. 2016-11-02 22:34:20 -04:00
Dev Team d3330c9663 allowing change of REQUEST_CODE value 2016-11-02 01:51:56 -07:00
Ralf Kistner 964dbab7b2 Bump sample app to 3.4.0. 2016-10-16 21:03:28 +02:00
Ralf Kistner 76861f8683 v3.4.0 2016-10-16 20:51:48 +02:00
Ralf Kistner 42d09b810b Merge branch 'handle-resolution-mismatch' 2016-10-16 20:36:14 +02:00
Ralf Kistner c4cbaba495 Handle case where resolution does not match the preview data. 2016-10-16 20:35:56 +02:00
Ralf Kistner 2373c88ca9 Merge pull request #181 from campelo/patch-1
lock orientation doesn't work
2016-10-16 19:55:58 +02:00
Ralf Kistner 4f311133ee Merge branch 'roxma-master' 2016-10-16 19:53:25 +02:00
Ralf Kistner 531918d28a Remove 150ms delay for beeps. 2016-10-16 19:52:39 +02:00
Ralf Kistner e3d3950d9a Simplify BeepManager. Beep based on media volume only. 2016-10-16 19:47:54 +02:00
roxma 1b8fbe60cc Create new MediaPlayer everytime when need a beep. For fixing issue #155 2016-10-08 21:43:38 +08:00
Ralf Kistner a2cc8e2756 Merge pull request #204 from jstemberger/Issue202
Added a check to see if the textureview is available and if it is the…
2016-10-05 09:35:31 +02:00
Ralf Kistner a7c8046c22 Merge pull request #210 from abickerton/master
Fixed deprecation
2016-10-05 09:34:49 +02:00
Alec Bickerton 8992dc5710 Fixed deprecation 2016-09-04 19:18:04 +02:00
John Stemberger 33b88ed645 Added a check to see if the textureview is available and if it is then trigger the onSurfaceTextureAvailable listener 2016-08-26 12:08:04 -04:00
Ralf Kistner 50e3acce09 Suppress lint warning. 2016-07-14 17:35:55 +02:00
Ralf Kistner a8305bd237 Merge pull request #185 from Servus7/analyze-code-inspection
FEATURE: applies some "Analyze code inspection" advises
2016-07-14 17:29:02 +02:00
Ralf Kistner 11de8f4288 Merge pull request #184 from sschuberth/master
Simplify integration instructions
2016-07-14 17:28:30 +02:00
Servus7 c9e3bf415f adds missing 'NonNull' annotations 2016-07-04 14:16:44 +02:00
Servus7 e27bef5518 surpresses warning of checked deprecation 2016-07-04 14:14:11 +02:00
Servus7 9ea3e3ef08 replaces 'StringBuilder' with 'String'
Reduces number of method calls to make the code more efficent.
2016-07-04 14:08:45 +02:00
Servus7 03ab7214f6 adds missing javadoc 2016-07-04 14:05:16 +02:00
Servus7 0b07174be9 removes unnecessary namespace declarations 2016-07-04 13:53:09 +02:00
Servus7 50ea6bb48a replaces explicit type argument 2016-07-04 13:51:14 +02:00
Servus7 aefdceaffd removes unnecessary new lines 2016-07-04 13:50:08 +02:00
Servus7 91157bc907 simplifies if statement 2016-07-04 13:42:16 +02:00
Servus7 4c745d697b deletes unnecessary imports 2016-07-04 13:39:03 +02:00
Sebastian Schuberth 2219087d6a Simplify integration instructions
The @aar syntax is only required if there also is a jar artifact to
distinguish from. It also has the side-effect to trigger "artifact only"
mode for Gradle, resulting in transitive module dependencies not being
resolved automatically, which was previously worked around by eitehr
specifying "transitive = true" or "com.google.zxing:core:3.2.1" directly.
neitehr is required if we just omit the @aar, which works fine as there is
no competing jar artifact.
2016-07-04 13:38:54 +02:00
Flavio Campelo c81ea8e6eb lock orientation doesn't work
this if condiction is inside lockOrientation method (right)
with this change, now the orientation will work when set manually.
2016-06-22 13:48:11 -03:00
Ralf Kistner 8ae76eaac6 Prepare release for 3.3.0. 2016-06-05 19:14:01 +02:00
Ralf Kistner 7d47cd352a Merge branch 'next-cleanup' 2016-06-05 19:09:20 +02:00
Ralf Kistner 3e12faa379 Add sample release config. 2016-06-05 19:08:59 +02:00
Ralf Kistner cac37cb7e5 Update documentation and add issue template. 2016-06-05 18:58:54 +02:00
Ralf Kistner 39430544f6 Update gradle tools. 2016-06-05 17:51:28 +02:00
Ralf Kistner e7fce1f563 Merge pull request #170 from gmazzo/patch-1
Update README.md
2016-05-31 18:35:12 +02:00
Guillermo Mazzola 5ad456a5d0 Update README.md
Improving the 'Changing the orientation' documentation
2016-05-24 15:33:16 -03:00
Ralf Kistner 905e4a33d6 Merge pull request #161 from lucasddaniel/master
Creating a timeout to finish the scan screen
2016-05-11 20:18:46 +02:00
Lucas Daniel d34fa22d7a create a new constructor to finish the barcode scan on predefined finish time. 2016-05-10 22:25:35 -03:00
Lucas Daniel cb68383a4c create a new constructor to finish the barcode scan on predefined finish time. 2016-05-10 21:59:47 -03:00
Ralf Kistner 842895f0c4 Add some docs and expose more camera internals. 2016-03-29 12:21:50 +02:00
Ralf Kistner 0aebd7b795 Rename CompoundBarcodeView -> DecoratedBarcodeView. 2016-03-29 12:04:00 +02:00
Ralf Kistner 706c407351 v3.2.0; Readme updates. 2016-02-06 16:42:37 +02:00
Ralf Kistner 962592eab4 Update readme instructions. 2016-02-06 16:31:53 +02:00
Ralf Kistner 2e5ec9e78c Improve sample with margin for older devices. 2016-02-06 16:27:10 +02:00
Ralf Kistner 7d2c96ffad Merge pull request #135 from journeyapps/refactor-preview-scaling
New preview scaling logic
2016-02-06 16:12:50 +02:00
Ralf Kistner db3962cd3c Merge branch 'master' into refactor-preview-scaling 2016-02-06 16:03:47 +02:00
Ralf Kistner 3bb383147d Slight adjustments to scaling strategies; add tests. 2016-02-06 16:01:26 +02:00
Ralf Kistner 062feb8453 Merge pull request #134 from journeyapps/fix/paused-viewfinder
Keep drawing viewfinder after pausing
2016-02-06 14:40:30 +02:00
Ralf Kistner 9dd1022ba2 Merge pull request #133 from journeyapps/fix/camera-initialization
Fix camera initialization
2016-02-06 14:40:21 +02:00
Ralf Kistner a7ee170653 Merge pull request #136 from journeyapps/fix/torch-control
Save torch state
2016-02-06 14:40:11 +02:00
Ralf Kistner ed3eddd357 Save torch state. 2016-02-06 14:30:45 +02:00
Ralf Kistner d0876fbd10 Merge pull request #112 from RK-IT-Media/master
more control over focus mode
2016-02-06 14:12:41 +02:00
Ralf Kistner 5cdd8fea69 Actually use safe mode when required. 2016-02-06 14:09:23 +02:00
Ralf Kistner d75b7a7c15 Fix regression. 2016-02-06 14:01:59 +02:00
Ralf Kistner 31bba74b34 Check for cameraInstance == null. 2016-02-06 14:00:53 +02:00
Ralf Kistner f0e0335ca4 Don't be too eager to reload camera on orientation change. 2016-02-06 14:00:10 +02:00
Ralf Kistner b61c0dc332 Keep drawing viewfinder after pausing. 2016-02-05 20:20:11 +02:00
Ralf Kistner 7bb0187ece Add notes on preview scaling. 2016-02-05 20:12:51 +02:00
Ralf Kistner c457d9a541 Default to using TextureView for direct usage of BarcodeView. 2016-02-05 19:28:05 +02:00
Ralf Kistner 568692eebe Extract common functionality into abstract class. 2016-02-05 19:19:59 +02:00
Ralf Kistner 3a05fc63a7 Allow specifying scaling strategies from the XML; add fitXY strategy. 2016-02-05 19:14:41 +02:00
Ralf Kistner cc0b16bc9d Different strategies for SurfaceView and TextureView. 2016-02-05 18:50:23 +02:00
Ralf Kistner 363db3cf73 New, semi-configurable scaling strategies. 2016-02-05 18:42:05 +02:00
Ralf Kistner 74d9b82a45 Merge pull request #123 from Kloudtek/master
Fixes journeyapps/zxing-android-embedded#117
2016-01-25 09:51:10 +02:00
Yannick Menager 72a90e75c1 Fixes journeyapps/zxing-android-embedded#117 2016-01-23 19:11:03 -08:00
Ralf Kistner 25b2997a51 Fix lint issues. 2015-12-29 16:42:51 +02:00
Ralf Kistner a3f546bc1a Fix build-tools issue on Travis. 2015-12-29 16:34:53 +02:00
Ralf Kistner 85a93e63b6 v3.1.0.
Update readme and changelog with details.
2015-12-29 16:15:14 +02:00
Ralf Kistner 56ef6c6dca Update sample with texture view. 2015-12-29 16:03:19 +02:00
Ralf Kistner dbf0067cf6 Merge branch 'surface-texture' 2015-12-29 15:57:08 +02:00
Ralf Kistner 77d0cdfe85 Merge branch 'upgrade/build-tools' 2015-12-29 15:56:46 +02:00
Ralf Kistner 002c8e676e Upgrade build tools and add initial runtime permission support. 2015-12-29 15:49:19 +02:00
Servus7 bcf2062b2b focus mode formatting correction 2015-12-18 14:59:06 +01:00
Servus7 878fc85f73 more control over focus mode
Provides finer control over focus mode. Now their are four modes where
you change choose from.
2015-12-18 14:46:57 +01:00
Ralf Kistner 5035f3c453 Merge branch 'master' of github.com:journeyapps/zxing-android-embedded 2015-11-01 19:03:23 +02:00
Ralf Kistner a35de1381a Merge pull request #97 from auchri/patch-1
Use newest version in README.md
2015-11-01 18:47:46 +02:00
auchri 2ace11eabc Use newest version in README.md 2015-10-31 22:56:39 +01:00
Ralf Kistner e25b6b5989 Default to SurfaceView; make useTextureView configurable. 2015-10-26 11:00:06 +02:00
Ralf Kistner e1de481ccd Improve lifecycle code. 2015-10-26 09:58:48 +02:00
Ralf Kistner 656363067d Fix centering of texture preview. 2015-10-26 09:49:35 +02:00
Ralf Kistner 4c12440dc6 Experimental SurfaceTexture support. 2015-10-23 16:51:06 +02:00
Ralf Kistner b95f7abba2 Abtract surface. 2015-10-23 15:47:38 +02:00
Ralf Kistner 856d634d5b Fix crash when framing rect is larger than the surface. 2015-10-18 20:56:24 +02:00
Ralf Kistner f0c7ad1fb3 Merge branch 'sunhoy-framing-rect' 2015-10-18 20:50:50 +02:00
Ralf Kistner ec1a4e7ccd Add getters and setters for framing rect size. 2015-10-18 20:35:50 +02:00
Ralf Kistner 8b7f5cae86 Move framing rectangle logic to CameraPreview. 2015-10-18 20:32:00 +02:00
Hanuk Lee and Sunho Yang 36962bcff1 [Issue #87] Changing size of framing rectangle in BarcodeView.
override calculateFramingRect method to make rectangle as a given size.
change parameters of initialize method so that we can set the values in the layout xml(custom_barcode_scanner.xml).
2015-10-07 14:46:22 -07:00
Ralf Kistner 4210396bd0 Update changelog. 2015-08-16 17:25:43 +02:00
Ralf Kistner b8fbbb9f60 v3.0.3 2015-08-16 17:22:07 +02:00
Ralf Kistner 5cc9968a58 Set preview FPS on Google Glass. 2015-08-16 17:20:34 +02:00
Ralf Kistner f616533466 Merge branch 'master' of github.com:journeyapps/zxing-android-embedded 2015-08-16 17:12:00 +02:00
Ralf Kistner 1deb4b55d4 Use windowTranslucentStatus in toolbar sample. 2015-08-16 17:02:27 +02:00
Ralf Kistner 624738f9ed Merge pull request #75 from commjoen/patch-1
Update ViewfinderView to be extendible
2015-08-07 09:36:03 +02:00
Jeroen Willemsen 5c97efddcf Update ViewfinderView to be extendible
We need to modify the ViewfinderView this way so that others can extend from it.
2015-08-07 08:04:54 +02:00
Ralf Kistner e9d0512b9f Merge pull request #72 from ALenfant/return_barcode_image
Add option to return the captured barcode image
2015-08-05 10:07:31 +02:00
Antonin Lenfant 0acaf239a6 Add option to return the captured barcode image 2015-08-04 18:12:35 +02:00
Ralf Kistner 3c04718814 v3.0.2 2015-07-21 10:14:13 +02:00
Ralf Kistner 213f020a4f Helper class for encoding barcodes. 2015-06-21 15:07:33 +02:00
Ralf Kistner 9c75630305 Merge branch 'magnumrocha-more-custom-configs' 2015-06-21 14:53:20 +02:00
Ralf Kistner c32a34e0e5 Use "torch" instead of "flashlight" to keep terminology consistent. 2015-06-21 14:52:03 +02:00
Ralf Kistner 60a3a99acf Some refactoring. 2015-06-21 14:49:12 +02:00
Magnum Rocha 4da6cedea6 Refactor method name. 2015-06-16 18:01:06 -04:00
Magnum Rocha b513c28bf9 Refactor method name. 2015-06-16 17:58:19 -04:00
Magnum Rocha da0338ad19 Add to the sample project the custom scanner example. 2015-06-16 17:12:45 -04:00
Magnum Rocha fe1ae0c102 Add support to user specify a custom layout for the CompoundBarcodeView component.
Add support to user control the flashlight on CompoundBarcodeView by a custom Activity.
Add support to user specify custom colors on ViewfinderView component.
2015-06-16 17:06:17 -04:00
Ralf Kistner d8648583f8 Update README.md
Fix formatting.
2015-06-14 20:06:24 +02:00
Ralf Kistner c85a5ce188 Update README.md
Better introduction.
2015-06-14 20:05:43 +02:00
Ralf Kistner dd49d8b3be v3.0.1 2015-06-10 09:46:51 +02:00
Ralf Kistner 6cd9c7b3d3 Add option to disable beep via IntentIntegrator. 2015-06-10 09:41:02 +02:00
Ralf Kistner ea0c7ed83f Don't assume we're in a Activity for CameraPreview.
This is specifically relevant for the layout preview.

Fixes #56.
2015-06-05 17:13:34 +02:00
Ralf Kistner 069b556241 Fix torch cancelling focus. 2015-06-05 16:44:09 +02:00
Ralf Kistner b8c0bf7d45 Add guidelines for reporting issues. 2015-05-31 16:01:51 +02:00
Ralf Kistner ddf0642984 Merge pull request #51 from journeyapps/leakcanary
Fix memory leak in RotationListener.
2015-05-20 14:01:44 +02:00
Ralf Kistner 45225545e0 Refactor RotationListener to reduce the effect of memory leaks. 2015-05-20 10:50:17 +02:00
Ralf Kistner 7abfa72d11 Enable LeakCanary to test for Activity leaks. 2015-05-20 09:22:13 +02:00
Ralf Kistner e2343191ef Update readme. 2015-05-17 11:26:47 +02:00
Ralf Kistner 2b973f5dbc Merge branch '3.x' of github.com:journeyapps/zxing-android-embedded into 3.x 2015-05-17 11:07:09 +02:00
Ralf Kistner dcbeb26d14 Update changelog. 2015-05-17 11:04:21 +02:00
Ralf Kistner 11ecd782e1 Remove legacy files. 2015-05-17 10:52:52 +02:00
Ralf Kistner 442365af77 Recommend jcenter repo. 2015-05-15 13:35:36 +02:00
Ralf Kistner d86a7dfed2 v3.0.0-beta4 2015-05-03 19:27:29 +02:00
Ralf Kistner d281cb0a1a Merge branch '3.x' of github.com:journeyapps/zxing-android-embedded into 3.x 2015-05-03 19:26:52 +02:00
Ralf Kistner cfddf30f0d v3.0.0-beta3 2015-05-03 19:25:13 +02:00
Ralf Kistner 4dd4d58295 Merge pull request #44 from journeyapps/appcompat
Simplify Custom Activities
2015-05-03 19:06:24 +02:00
Ralf Kistner 10b1b29f82 Add brief explanations on sample Activities. 2015-05-03 19:05:49 +02:00
Ralf Kistner 9968f4915b Fix lint error. 2015-05-03 19:01:17 +02:00
Ralf Kistner bba8496fb4 Install more up-to-date Android components on Travis. 2015-05-03 18:51:19 +02:00
Ralf Kistner 6afe954732 Make toolbar sample fullscreen. 2015-05-03 18:43:38 +02:00
Ralf Kistner 4b409dfd81 Improve handling of back button in toolbar sample. 2015-05-03 18:38:05 +02:00
Ralf Kistner ef569d6460 Rename DefaultBarcodeScannerView to CompoundBarcodeView. 2015-05-03 18:25:58 +02:00
Ralf Kistner 27dbe6a711 Refactor ContinuousCaptureActivity to use the compound barcode view. 2015-05-03 18:20:28 +02:00
Ralf Kistner c74750c3e6 Sample with AppCompat/Toolbar Activity. 2015-05-03 18:05:06 +02:00
Ralf Kistner 0bc95038bb Extract logic out of CaptureActivity. 2015-05-03 16:20:06 +02:00
Ralf Kistner 26b07ed902 Fix some code style issues. 2015-05-03 14:58:33 +02:00
Ralf Kistner 4672cf50c8 Add some more javadocs. 2015-05-03 14:51:54 +02:00
Ralf Kistner a29e5ad10f Merge branch 'fix-dead-decoder-thread' into 3.x 2015-05-03 14:06:38 +02:00
Ralf Kistner 4a7de7a4f5 Add lock for preview handler. 2015-05-03 14:04:16 +02:00
Ralf Kistner b81197efe9 Refactor PreviewCallback to prevent warnings.
Typical warning:
  java.lang.RuntimeException: Handler (android.os.Handler) sending message to a Handler on a dead thread

Fixes #38.
2015-05-03 13:58:57 +02:00
Ralf Kistner 71eaecbb03 Add some comments to sample project. 2015-05-03 13:09:11 +02:00
Ralf Kistner e5ea3c6c4e Merge branch '3.x' of github.com:journeyapps/zxing-android-embedded into 3.x 2015-05-03 12:26:56 +02:00
Ralf Kistner 0ef32b5bcf Merge branch 'BugMaker-bitmap_in_result' into 3.x 2015-05-03 12:25:56 +02:00
Ralf Kistner ed54f5c44c Enable bitmap scaling again. 2015-05-03 12:24:45 +02:00
Ralf Kistner 8f5134fbae Colour result bitmap; Encapsulate source data. 2015-05-03 12:17:40 +02:00
Ralf Kistner 33905500ba Change repository URL to https.
Fixes #39.
2015-04-28 07:55:29 +02:00
Eltsov Maksim 1ae87643a3 Small modifications 2015-04-15 12:29:57 +03:00
Eltsov Maksim 6871011551 Added preview of scanned image 2015-04-15 10:50:56 +03:00
Ralf Kistner b8a351985c Fix sample code for any orientation. 2015-04-10 14:18:13 +02:00
Ralf Kistner c04a600a91 Add zxing:core dependency to the readme. 2015-04-10 14:15:31 +02:00
Ralf Kistner 40db627e6b v3.0.0-beta2 2015-04-10 13:10:19 +02:00
Ralf Kistner 1a63fbdeae Fix comment on supported API versions. 2015-04-10 13:06:42 +02:00
Ralf Kistner 522414fa30 Fix decode orientation for non-native-portrait devices. 2015-04-09 21:00:24 +02:00
Ralf Kistner 2d09eca094 Don't assume the natural display orientation is portrait. 2015-04-09 16:32:44 +02:00
Ralf Kistner c95c7e7ad9 Use DecoderFactory instead of Decoder. 2015-04-06 19:20:56 +02:00
Ralf Kistner b8c1ebceab Fix readme. 2015-04-05 22:14:03 +02:00
Ralf Kistner 7a4fd34cff 3.0.0-beta1 2015-04-05 21:44:47 +02:00
Ralf Kistner 623cc0e79c Update readme. 2015-04-05 21:40:09 +02:00
Ralf Kistner 0d57fdd5fb Fix sample-nosupport. 2015-04-05 21:17:55 +02:00
Ralf Kistner b49642fa35 More cleanup. 2015-04-05 21:13:07 +02:00
Ralf Kistner ba81c4149b Reformat code with 4-space indentation. 2015-04-05 21:00:29 +02:00
Ralf Kistner c5687925ca Remove legacy lib; merge integration into zxing-android; rename to zxing-android-embedded. 2015-04-05 20:56:15 +02:00
Ralf Kistner dae3221039 Some cleanup. 2015-04-05 20:51:14 +02:00
Ralf Kistner f14acff90e Port AmbientLightManager. 2015-04-05 20:37:58 +02:00
Ralf Kistner 16c5c92704 Disable metering on API < 15. 2015-04-05 18:34:51 +02:00
Ralf Kistner e6324ee2b4 Revert regression in AutoFocusManager. 2015-04-05 18:24:47 +02:00
Ralf Kistner 14e40e2d66 Major lint issues are fixed, remaining ones ignored. 2015-04-05 18:20:30 +02:00
Ralf Kistner 7b19c20e0d Remove some unused strings. 2015-04-05 18:12:29 +02:00
Ralf Kistner cb32669b10 Gingerbread compatibility. 2015-04-05 18:01:28 +02:00
Ralf Kistner 74b18fb861 We do not need a Context for CameraInstance / CameraManager. 2015-04-05 17:52:40 +02:00
Ralf Kistner 39c164eb16 Use Handler for AutoFocusManager. 2015-04-05 17:51:15 +02:00
Ralf Kistner 71e70ea26c Remember orientation lock. 2015-04-05 17:30:22 +02:00
Ralf Kistner cac7dbb4d7 Rewrite InactivityTimer. 2015-04-05 17:22:27 +02:00
Ralf Kistner d590c333a5 Lock display to opening orientation by default. 2015-04-05 13:04:47 +02:00
Ralf Kistner 7bdd6f7428 Display dialog for camera errors. 2015-04-04 19:48:09 +02:00
Ralf Kistner 4c242b8662 More resource cleanup. 2015-04-04 19:46:09 +02:00
Ralf Kistner ccbe0254e8 Update sample text. 2015-04-04 18:21:15 +02:00
Ralf Kistner c0490472b7 Remove remaining preferences. 2015-04-04 18:18:52 +02:00
Ralf Kistner f82223445f Remove unused resources. 2015-04-04 18:10:52 +02:00
Ralf Kistner 0b035e58a7 Remove old sources. 2015-04-04 18:04:26 +02:00
Ralf Kistner b8e53c4d1e Add InactivityTimer and BeepManager to new CaptureActivity. 2015-04-04 17:54:17 +02:00
Ralf Kistner efdb192aa6 New CaptureActivity. 2015-04-04 17:32:24 +02:00
Ralf Kistner 3e74da3f7a Fix issues with surface lifecycle when the size doesn't change. 2015-04-04 17:15:19 +02:00
Ralf Kistner beec54a944 Add comment. 2015-04-03 22:27:59 +02:00
Ralf Kistner 0d5a470f5d New algorithm for calculating preview size. 2015-04-03 22:20:53 +02:00
Ralf Kistner 077b2fe80e Enable turning torch on/off at runtime. 2015-04-03 18:42:23 +02:00
Ralf Kistner 0009a9c8b9 Extract generic camera functionlity into CameraPreview. 2015-04-03 17:47:16 +02:00
Ralf Kistner 1c357625fb Allow starting/stopping decoding without stopping preview. 2015-04-01 19:26:59 +02:00
Ralf Kistner 06088e84b2 Don't start preview before surface is the correct size. 2015-04-01 18:54:04 +02:00
Ralf Kistner f778ac956b Move RotationListener to BarcodeView. 2015-04-01 18:43:47 +02:00
Ralf Kistner b3c17e742a Handle rotation inversion. 2015-04-01 17:47:11 +02:00
Ralf Kistner c9de43f9d8 Minor optimization. 2015-04-01 17:46:44 +02:00
Ralf Kistner d86b60c002 Fix inverted preview rotations. 2015-04-01 17:07:36 +02:00
Ralf Kistner 3bc9e73980 Add pause/resume buttons for testing. 2015-04-01 16:38:13 +02:00
Ralf Kistner 902f2c6f58 Fix decodingThread startup cycle. 2015-04-01 16:35:48 +02:00
Ralf Kistner 699e93db5b Fix some crashes. 2015-04-01 16:28:04 +02:00
Ralf Kistner 05cc7cd3a6 Create SurfaceView immediately again. 2015-04-01 16:17:38 +02:00
Ralf Kistner 5b4bd9dfbc Default to black background. 2015-04-01 15:44:36 +02:00
Ralf Kistner 808a45d665 Refactor initialization cycle. 2015-04-01 15:27:44 +02:00
Ralf Kistner d16d2766e9 Merge branch 'master' into rewrite
Conflicts:
	zxing-android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java
2015-04-01 13:04:36 +02:00
Ralf Kistner 4cd6252713 v2.3.0 2015-04-01 11:07:38 +02:00
Ralf Kistner 876b29ef5f Merge branch 'fix-decode-orientation' 2015-04-01 10:58:48 +02:00
Ralf Kistner a50ca1b21a Fix decode orientation for portrait mode. 2015-04-01 10:58:04 +02:00
Ralf Kistner a810eaf46f Merge branch 'zxing-updates' 2015-04-01 10:47:32 +02:00
Ralf Kistner b0438e082a Apply updates to zxing-android. 2015-04-01 10:47:13 +02:00
Ralf Kistner b79de5d47a Update to zxing upstream zxing-3.2.0-21-gbc3c8e3 2015-04-01 10:44:50 +02:00
Ralf Kistner 5801b63370 Merge branch 'refactor' 2015-04-01 10:42:05 +02:00
Ralf Kistner fcd5982861 Refactor CameraThread. 2015-03-31 22:42:19 +02:00
Ralf Kistner 9056458ea8 Fix orientation issues. 2015-03-31 18:32:10 +02:00
Ralf Kistner bb5d984c0c Refactor CameraManager. 2015-03-31 17:31:18 +02:00
Ralf Kistner 259f961500 Simplify ViewfinderView slightly. 2015-03-31 11:06:36 +02:00
Ralf Kistner 15af079cfe Draw ResultPoints in viewfinder. 2015-03-30 18:33:50 +02:00
Ralf Kistner 95031b3bcc Fix rotation of image in portrait mode. 2015-03-30 18:02:50 +02:00
Ralf Kistner bf3a584344 Implement framing rect and viewfinder. 2015-03-29 21:51:07 +02:00
Ralf Kistner a12142d3c5 Maintain preview aspect ratio by doing either center or crop. 2015-03-29 16:49:35 +02:00
Ralf Kistner 5908caea35 Generic callbacks. 2015-03-29 15:57:56 +02:00
Ralf Kistner 28a855c776 Refactor decoder config. 2015-03-29 15:27:22 +02:00
Ralf Kistner bfa2ba413e Experimental decoding. 2015-03-29 15:11:34 +02:00
Ralf Kistner 12be735f40 Better thread handling. 2015-03-29 14:20:01 +02:00
Ralf Kistner 7a44f8198c Experiment with async camera access. 2015-03-29 13:11:53 +02:00
Ralf Kistner d4484a58c6 Remove more unused code. 2015-03-29 12:02:53 +02:00
Ralf Kistner 1a3ea5c323 More cleanup. 2015-03-28 18:48:57 +02:00
Ralf Kistner d11d76693b Remove more dead code. 2015-03-28 18:34:09 +02:00
Ralf Kistner 087a67fce7 Further cleanup of unused code. 2015-03-28 18:13:11 +02:00
Ralf Kistner 4c6cdcc8c5 Change default result duration to 0. 2015-03-28 18:09:48 +02:00
Ralf Kistner a9c9bd7585 Fix update script. 2015-03-28 18:04:49 +02:00
Ralf Kistner 08eac66e5d Remove unused results view. 2015-03-28 17:56:15 +02:00
Ralf Kistner f6d9380359 Update changelog. 2015-03-28 14:54:52 +02:00
Ralf Kistner 324a84c9c4 v2.2.0 2015-03-28 14:51:48 +02:00
Ralf Kistner cec0bd2102 Add warning for setOrientation option. 2015-03-28 14:50:25 +02:00
Ralf Kistner a57e9eb3fc Some cleanup. 2015-03-28 14:45:34 +02:00
Ralf Kistner 2cbceb1b6a Merge branch 'orientation-support' 2015-03-28 13:47:47 +02:00
Ralf Kistner 7c3a9c750c Clarify button text. 2015-03-28 13:47:27 +02:00
Ralf Kistner d471200703 Allow specifying a custom orientation. 2015-03-20 16:07:08 +02:00
Ralf Kistner bed85b1149 Correct handling of different orientations. 2015-03-20 15:49:29 +02:00
Ralf Kistner 89296fd1e6 Calculate wide framing rect in CaptureActivity instead of the intent. 2015-03-20 14:54:36 +02:00
529 changed files with 10379 additions and 34742 deletions
+21
View File
@@ -0,0 +1,21 @@
name: Build Android
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Build and Lint with Gradle
run: ./gradlew build
- name: Archive lint results
uses: actions/upload-artifact@v2
with:
name: lint-results
path: "**/build/reports/lint-results*"
+4 -1
View File
@@ -7,4 +7,7 @@ maven-repository
*.iml
local.properties
mvn-clone
*.keystore
.project
.settings
.classpath
-6
View File
@@ -1,6 +0,0 @@
language: android
jdk: oraclejdk7
script:
- TERM=dumb ./gradlew build
+153 -4
View File
@@ -1,15 +1,164 @@
### 2.1.0
### 4.3.0 (2021-10-25)
* Minimum SDK version 19, but requires additional config (see readme) for < 24 compatibility.
* Add ScanOptions and ScanContract for use with `registerForActivityResult()`.
* Deprecates IntentIntegrator.
* Use minimal AndroidX libraries.
### 4.2.0 (2021-03-15)
* Fix MediaPlayer warnings (#587).
* Prevent CameraConfigurationUtils clash (#609).
* Add licenses to POM (#556).
* Bug: Crashes on SDK versions older than 21 (#645).
### 4.1.0 (2020-01-07)
* Ability to hide the laser in ViewfinderView (#503).
* Make possibleResultPoints method in BarcodeCallback optional (#504).
* Ability to customize or disable the permission error dialog (#505).
### 4.0.2 (2019-09-07)
* Use androidx.
* Use zxing:core 3.4.0 by default.
* Minimum SDK version 24.
* Fix ArithmeticException.
* Fix ResultPoint locations when camera is mirrored.
### 4.0.0 / 4.0.1 (2019-09-07)
* Broken release - use 4.0.2.
### 3.6.0 (2018-03-04)
* Use zxing:core 3.3.2 by default (#360).
* Minimum SDK version 19, or 14 by using zxing:core 3.3.0.
* Fix preview race condition (#324).
* Request code can now specified per Intent, instead of globally (#287).
* More helpers to specify barcode formats.
* Allow scanning both inverted and non-inverted barcodes at the same time (alternating) (#326).
* More examples.
### 3.5.0 (2017-03-20)
* Allow changing the REQUEST_CODE value (#234).
* Add support for inverted scans (#235).
* Use zxing:core 3.3.0 by default (#265).
Fixes:
* Fix memory leak when using scan timeout (#283).
* Better handling of various camera errors (#241, #268, #270)
### 3.4.0 (2016-10-16)
Changes:
* Beep on scan is now controlled only by the media volume, and still plays
even if the device is in "silent mode", as long as the media volume is not muted.
* The 150ms delay after scanning is removed.
Fixes:
* An issue where the beep sometimes played twice is fixed (#221).
* Fix rare crash (#209)
* Fix orientation lock issue (#181)
* Fix race condition with TextureView (#204)
### 3.3.0 (2016-06-05)
* Add an optional timeout to cancel scanning. (#161)
* Rename CompoundBarcodeView to DecoratedBarcodeView.
* Add more internal documentation (comments).
### 3.2.0 (2016-02-06)
* Improved preview scaling strategies, configurable between centerCrop, fitCenter, fitXY (#135)
* Fix issues with Android 6 permission support (#123)
* Fix camera initialization issues, specifically related to orientation changes (#133)
* More control over focus mode (#112)
* Keep drawing viewfinder frame after scanning / pausing (#134)
* More control over torch state, and save the state on orientation change (#136)
### 3.1.0 (2015-12-29)
* Add support for Android 6 runtime permissions (Camera only).
* Experimental support for using TextureView instead of SurfaceView.
* Fix build issues with custom attributes.
* Support library version 23+ is now a requirement.
### 3.1.0 (2015-12-29)
* Initial Android 6 permission supoprt
### 3.0.3 (2015-08-16)
* Fix for preview on Google Glass.
* Make ViewfinderView extensible. (#75)
* Add option to return image of barcode via Intents. (#72)
### 3.0.2 (2015-07-21)
* Add helper class for encoding barcodes.
* Support custom layouts for CompoundBarcodeView.
### 3.0.1 (2015-06-10)
* Fix auto-focus stopping when enabling the torch.
* Fix rendering of BarcodeView / CompoundBarcodeView in layout preview of Android Studio.
* Add option to disable beep via IntentIntegrator.
* Fix some memory leaks with RotationListener (affected some devices only).
### 3.0.0 (2015-05-17)
* First stable release of 3.0.
### 3.0.0-beta4 (2015-05-03)
* Extract functionality out of CaptureActivity into CompoundBarcodeView and CaptureManager.
* Add sample with Lollipop Toolbar/Actionbar (using appcompat library).
### 3.0.0-beta3 (2015-05-03)
* Add preview of scanned image to the result.
* For some warnings for "sending message to a Handler on a dead thread"
### 3.0.0-beta2 (2015-04-10)
* Use DecoderFactory instead of Decoder.
* Fix some orientation issues.
### 3.0.0-beta1 (2015-04-05)
* Major rewrite, allowing the library to be embedded in other Activities. See the new README for
details.
### 2.3.0 (2015-04-01)
* Fix issues with portrait orientation.
* Fix camera id used when resuming (from upstream ZXing)
* Change default result duration to 0.
* Remove more unused code.
### 2.2.0 (2015-03-28)
* Experimental setOrientation() option.
### 2.1.0 (2015-03-20)
* Update to ZXing 3.2.0.
* Removed HelpActivity and EncodeActivity. If there is a need for EncodeActivity, it can be split
off as a separate lib. Thanks to @rehan-vanzyl.
* Remove some permissions and `<supports-screens>` section from the AndroidManifest.xml.
### 2.0.1
### 2.0.1 (2014-12-20)
* Changed group name, artifact name, GitHub organization and Maven repository.
### 2.0.0
### 2.0.0 (2014-06-03)
There are now three libraries:
* zxing-android-minimal (equivalent to Barcode Scanner 4.7.0)
@@ -24,7 +173,7 @@ Other changes:
* Rewrote IntentIntegrator, based on the official IntentIntegrator 3.0.1.
### 1.2.1
### 1.2.1 (2014-05-16)
* Add support for custom capture layouts thanks to @martar.
* Add some helper methods to IntentIntegrator.
+84
View File
@@ -0,0 +1,84 @@
## Embedding BarcodeView
For more control over the UI or scanning behaviour, some components may be used directly:
* BarcodeView: Handles displaying the preview and decoding of the barcodes.
* DecoratedBarcodeView: Combines BarcodeView with a viewfinder for feedback, as well as some status /
prompt text.
* CaptureManager: Manages the InactivityTimer, BeepManager, orientation lock, and returning of the
barcode result.
These components can be used from any Activity or Fragment.
This is much more low-level than using IntentIntegrator. Your code becomes responsible for:
* Setting up the BarcodeView (doesn't have all the helpers from IntentIntegrator)*
* Requesting permission to do the Camera.
* Making sure only one Camera instance is active at a time.
* Handling the scan results.
Samples:
* [ContinuousCaptureActivity][6]: continuously scan and display results (instead of a once-off scan).
* [ToolbarCaptureActivity][8]: Same as the normal CaptureActivity, but with a Lollipop Toolbar.
## Notes on threading
For a responsive user interface, all camera operations happen on a dedicated background thread.
In most cases this doesn't matter, but it does mean that the camera is not released immediately
when the BarcodeView is paused. If you want to start using the camera for something else
immediately after scanning, use `BarcodeView#pauseAndWait()` instead of `BarcodeView#pause()`.
This will block the main thread until the camera is released.
## Notes on scaling
On each Android device, the camera has a set list of available preview sizes. When embedding the
barcode scanning along with other components on an Activity, there will almost never be a preview
size that matches up exactly, so we have to pick one and scale and/or crop it.
Also affecting this is that either SurfaceView or TextureView can be used to display the preview.
SurfaceView has better performance, but does not support cropping. TextureView is more powerful,
but has some performance overhead, and is only supported on Android API 14+. We use SurfaceView by
default.
To avoid aspect ratio distortion, we can crop the preview. However, in some combinations of
SurfaceView and other components, the camera preview may end up displaying outside the SurfaceView,
and over other components. This happens especially when:
1. Placing the scanner inside a dialog, or:
2. Other components are placed before the (Decorated)BarcodeView, resulting in a lower z-order.
For these cases we have two solutions:
1. Use TextureView instead of SurfaceView. This may have a performance impact, but solves the above
issues. Note that this is only available with Android API 14+.
2. Use either `fitCenter` or `fitXY` for scaling, instead of `centerCrop`. Note that `fitCenter` may
result in black bars next to the preview, and `fitXY` may distort the aspect ratio.
The default is to:
1. Use TextureView on Android API 14+, SurfaceView on lower versions.
2. Use `centerCrop` scaling when TextureView is used.
3. Use `fitCenter` if SurfaceView is used.
You can override these options:
```xml
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:layout_width="..."
android:layout_height="..."
app:zxing_use_texture_view="false" (defaults to true, only has an effect on Android API 14+)
app:zxing_preview_scaling_strategy="centerCrop"/> (or fitCenter / fitXY)
```
For a full-screen barcode scanner with no Toolbar, the recommended options are:
```
app:zxing_use_texture_view="false"
app:zxing_preview_scaling_strategy="centerCrop"
```
[8]: sample/src/main/java/example/zxing/ToolbarCaptureActivity.java
[6]: sample/src/main/java/example/zxing/ContinuousCaptureActivity.java
+33
View File
@@ -0,0 +1,33 @@
#### Description of the problem:
**Which library version are you using?** E.g. 3.2.0.
**Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0)**
**Does the same happen on other devices or an emulator?**
**Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?**
**In the case of an error do you have a stack trace or adb logs?**
<!--
If you have an issue scanning specific barcodes, please test with the Barcode Scanner application,
available on the Play Store: https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en
If you are also not able to scan the barcode there, the issue may be with the underlying zxing library,
in which case you should report the issue here: https://github.com/zxing/zxing/issues
-->
<!--
If you have a question on usage of the library, please check the documentation and sample
application first:
https://github.com/journeyapps/zxing-android-embedded/blob/master/README.md
https://github.com/journeyapps/zxing-android-embedded/blob/master/EMBEDDING.md
https://github.com/journeyapps/zxing-android-embedded/tree/master/sample/src/main/java/example/zxing
-->
+199 -88
View File
@@ -1,129 +1,221 @@
# ZXing Android Minimal
# ZXing Android Embedded
This is a port of the [ZXing Android Barcode Scanner application](https://github.com/zxing/zxing/) as an Android
library project, for embedding in other Android applications. This is not affiliated with the official ZXing project.
Barcode scanning library for Android, using [ZXing][2] for decoding.
Generally it is recommended to scan a barcode [via intents](https://github.com/zxing/zxing/wiki/Scanning-Via-Intent).
There are however some cases in which it is not feasible:
The project is loosely based on the [ZXing Android Barcode Scanner application][2], but is not affiliated with the official ZXing project.
* Your users cannot install the Barcode Scanner application.
* You need to customise the barcode scanning logic.
* You need to customise the UI.
Features:
In these cases, this library may be more suitable.
1. Can be used via Intents (little code required).
2. Can be embedded in an Activity, for advanced customization of UI and logic.
3. Scanning can be performed in landscape or portrait mode.
4. Camera is managed in a background thread, for fast startup time.
A sample application is available in [Releases](https://github.com/journeyapps/zxing-android-embedded/releases).
By default, Android SDK 24+ is required because of `zxing:core` 3.4.x.
SDK 19+ is supported with additional configuration, see [Older SDK versions](#older-sdk-versions).
## Adding aar dependency with Gradle
**Please note that the repository, group name and artifact names changed in 2.0.1.**
Add the following to your `build.gradle` file:
Add the following to your build.gradle file:
```groovy
// Config for SDK 24+
repositories {
mavenCentral()
}
dependencies {
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
}
```
## Older SDK versions
By default, only SDK 24+ will work, even though the library specifies 19 as the minimum version.
For SDK versions 19+, one of the changes below are required.
Some older SDK versions below 19 may work, but this is not tested or supported.
### Option 1. Downgrade zxing:core to 3.3.0
```groovy
repositories {
mavenCentral()
}
maven {
url "http://dl.bintray.com/journeyapps/maven"
dependencies {
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
}
```
### Option 2: Desugaring (Advanced)
This option does not require changing library versions, but may complicate the build process.
This requires Android Gradle Plugin version 4.0.0 or later.
See [Java 8+ API desugaring support](https://developer.android.com/studio/write/java8-support#library-desugaring).
Example for SDK 21+:
```groovy
android {
defaultConfig {
minSdkVersion 21
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
// Supports Android 4.0.3 and later (API level 15)
compile 'com.journeyapps:zxing-android-embedded:2.1.0@aar'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
// Supports Android 2.1 and later (API level 7), but not optimal for later Android versions.
// If you only plan on supporting Android 4.0.3 and up, you don't need to include this.
compile 'com.journeyapps:zxing-android-legacy:2.1.0@aar'
// Convenience library to launch the scanning Activities.
// It automatically picks the best scanning library from the above two, depending on the
// Android version and what is available.
compile 'com.journeyapps:zxing-android-integration:2.1.0@aar'
// Version 3.0.x of zxing core contains some code that is not compatible on Android 2.2 and earlier.
// This mostly affects encoding, but you should test if you plan to support these versions.
// Older versions e.g. 2.2 may also work if you need support for older Android versions.
compile 'com.google.zxing:core:3.2.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
```
### What's the difference between zxing-android-embedded and zxing-android-legacy?
SDK 19+ additionally requires multiDex. In addition to these gradle config changes, the Application
class must also be changed. See for details: [Configure your app for multidex](https://developer.android.com/studio/build/multidex#mdex-gradle).
The official ZXing Barcode Scanner application dropped support for older Android versions, and newer
releases only support Android 4.0.3 and newer. If you install it on an older Android version from
the Play Store, you will get an older version of the Barcode Scanner.
```groovy
android {
defaultConfig {
multiDexEnabled true
minSdkVersion 19
}
In order to keep up to date with the latest changes and improvements from the official project, we
need to do the same. However, many applications still need to support older Android versions.
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
To cater for these applications, we have two libraries:
dependencies {
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
1. zxing-android-embedded - This corresponds to the latest Barcode Scanner version.
2. zxing-android-legacy - This corresponds to version 2.2 of the ZXing project -
the latest version that supported Android 2.2.
`zxing-android-embedded` uses a `zxing` prefix for all its resources, while `zxing-android-legacy`
uses a `zxinglegacy` prefix. It is therefore possible to include both of these in your application.
If you include both, `IntentIntegrator` will automatically choose the best one.
If you only need to support Android 4.0.3 and newer, you only need the `zxing-android-embedded`
library.
It is also possible to only use the `zxing-android-legacy` library, but it does not include the
latest updates and bugfixes from the ZXing project.
## Adding apklib dependency with Maven
Support for Maven apklib is dropped in version 1.2.0.
Use the [1.1.x branch](https://github.com/journeyapps/zxing-android-embedded/tree/1.1.x) if you need to use this from a Maven project.
## Usage
Launch the intent with the default options:
```java
new IntentIntegrator(this).initiateScan(); // `this` is the current Activity
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation "androidx.multidex:multidex:2.0.1"
}
```
Use from a Fragment:
```java
IntentIntegrator.forFragment(this).initiateScan(); // `this` is the current Fragment
## Hardware Acceleration
// If you're using the support library, use IntentIntegrator.forSupportFragment(this) instead.
Hardware acceleration is required since TextureView is used.
Make sure it is enabled in your manifest file:
```xml
<application android:hardwareAccelerated="true" ... >
```
## Usage with ScanContract
Note: `startActivityForResult` is deprecated, so this example uses `registerForActivityResult` instead.
See for details: https://developer.android.com/training/basics/intents/result
`startActivityForResult` can still be used via `IntentIntegrator`, but that is not recommended anymore.
```java
// Register the launcher and result handler
private final ActivityResultLauncher<ScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(),
result -> {
if(result.getContents() == null) {
Toast.makeText(MyActivity.this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(MyActivity.this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
});
// Launch
public void onButtonClick(View view) {
barcodeLauncher.launch(new ScanOptions());
}
```
Customize options:
```java
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
integrator.setPrompt("Scan a barcode");
integrator.setResultDisplayDuration(0);
integrator.setWide(); // Wide scanning rectangle, may work better for 1D barcodes
integrator.setCameraId(0); // Use a specific camera of the device
integrator.initiateScan();
ScanOptions options = new ScanOptions();
options.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);
options.setPrompt("Scan a barcode");
options.setCameraId(0); // Use a specific camera of the device
options.setBeepEnabled(false);
options.setBarcodeImageEnabled(true);
barcodeLauncher.launch(options);
```
See [IntentIntegrator](integration/src/main/java/com/google/zxing/integration/android/IntentIntegrator.java) for more options.
See [BarcodeOptions][5] for more options.
### Custom Layout
### Generate Barcode example
You can provide a custom layout for the capture activity. Note that you'll need to provide two
different layouts if you are using both zxing-android-embedded and zxing-android-legacy.
See [custom_capture_layout.xml](sample/src/main/res/layout/custom_capture_layout.xml) and
[custom_legacy_capture_layout.xml](sample/src/main/res/layout/custom_legacy_capture_layout.xml) for
examples.
While this is not the primary purpose of this library, it does include basic support for
generating some barcode types:
```java
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCaptureLayout(R.layout.custom_layout);
integrator.setLegacyCaptureLayout(R.layout.custom_legacy_layout);
integrator.initiateScan();
try {
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
Bitmap bitmap = barcodeEncoder.encodeBitmap("content", BarcodeFormat.QR_CODE, 400, 400);
ImageView imageViewQrCode = (ImageView) findViewById(R.id.qrCode);
imageViewQrCode.setImageBitmap(bitmap);
} catch(Exception e) {
}
```
For a cancel/back button, use the ids `@id/zxing_back_button` for zxing-android-embedded and
`@id/zxinglegacy_back_button` for zxing-android-legacy.
To customize the generated barcode image, use the `setBackgroundColor` and `setForegroundColor` functions of the
`BarcodeEncoder` class with a [`@ColorInt`](https://developer.android.com/reference/androidx/annotation/ColorInt)
value to update the background and foreground colors of the barcode respectively. By default, the barcode has a
white background and black foreground.
### Changing the orientation
To change the orientation, specify the orientation in your `AndroidManifest.xml` and let the `ManifestMerger` to update the Activity's definition.
Sample:
```xml
<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="fullSensor"
tools:replace="screenOrientation" />
```
```java
ScanOptions options = new ScanOptions();
options.setOrientationLocked(false);
barcodeLauncher.launch(options);
```
### Customization and advanced options
See [EMBEDDING](EMBEDDING.md).
For more advanced options, look at the [Sample Application](https://github.com/journeyapps/zxing-android-embedded/blob/master/sample/src/main/java/example/zxing/MainActivity.java),
and browse the source code of the library.
This is considered advanced usage, and is not well-documented or supported.
## Android Permissions
The camera permission is required for barcode scanning to function. It is automatically included as
part of the library. On Android 6 it is requested at runtime when the barcode scanner is first opened.
When using BarcodeView directly (instead of via IntentIntegrator / CaptureActivity), you have to
request the permission manually before calling `BarcodeView#resume()`, otherwise the camera will
fail to open.
## Building locally
@@ -141,11 +233,30 @@ You can then use your local version by specifying in your `build.gradle` file:
## Sponsored by
[Journey][1] - Build enterprise mobile apps for iOS and Android. Work in the cloud, code in JavaScript and forget about back-end development.
[JourneyApps][1]
## License
[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
Licensed under the [Apache License 2.0][7]
Copyright (C) 2012-2022 ZXing authors, Journey Mobile
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[1]: http://journeyapps.com
[2]: https://github.com/zxing/zxing/
[5]: zxing-android-embedded/src/com/journeyapps/barcodescanner/ScanOptions.java
[7]: http://www.apache.org/licenses/LICENSE-2.0
-48
View File
@@ -1,48 +0,0 @@
# Updating ZXing
This outlines the process to bring this library up to date with the latest changes from the official
ZXing project.
## 1. zxing-android-complete
This is a "complete" version of the BarcodeScanner project, converted to a library. The first step
is to update this.
1. Clone the zxing project from Github. The scripts assume that zxing-android-minimal and zxing
are in the same folder.
2. In `zxing-android-complete`, run `ruby update.rb`.
3. Inspect the changes with `git diff`, and check that the changes make sense.
4. Test that the project can compile and run. A simple way to test is to replace
`compile(project(':zxing-android'))` with `compile(project(':zxing-android-complete'))` in
[sample/build.gradle](sample/build.gradle), and test the sample project.
5. Commit the changes.
See [zxing-android-complete/Readme.md](zxing-android-complete/Readme.md) for more details on the
conversion process.
## 2. zxing-android
This is a stripped-down version of zxing-android-complete. Some of the work to produce the
stripped-down version is automated, but some is manual.
The project contain two source folders and two resource folders. `src-orig` and `res-orig` contain
sources and resources from zxing-android-complete that are either unmodified, or adapted
automatically by the update script. `src` and `res` contains sources and resources that are manually
adapted for the library.
1. Make sure zxing-android-complete is updated (see above).
2. In `zxing-android`, run `ruby update.rb`.
3. Inspect the changes with `git diff`, and check that the changes make sense.
4. Inspect `zxing-android/res.patch` and `zxing-android/sources.patch`. This contains the diff
between the files in our `res` and `src` folders, and the ones from zxing-android-complete.
Use this, along with the changes between that were made in the zxing-android-complete project
to these files, to manually update them.
5. Manually update AndroidManifest.xml if required.
6. Test!
7. Commit and make a pull request.
Notes:
* Assets (used for the help section) are not covered by this conversion process at all. We need a
better overall plan here on how to handle help files (Use the stock Barcode Scanner help files?
Completely remove the help section?).
+14 -78
View File
@@ -1,88 +1,24 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
}
}
repositories {
google()
mavenCentral()
}
// Projects to be published to bintray
def PUBLISH_PROJECTS = ['zxing-android', 'zxing-android-legacy', 'integration']
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
}
}
subprojects {
repositories {
jcenter()
google()
mavenLocal()
mavenCentral()
}
version = '2.1.0'
version = '4.3.0'
group = 'com.journeyapps'
apply plugin: 'android-sdk-manager'
ext.androidBuildTools = '21.1.2'
ext.androidTargetSdk = 21
ext.zxingCore = 'com.google.zxing:core:3.2.0'
if (PUBLISH_PROJECTS.contains(project.name)) {
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
project.ext.artifactId = project.name // Default to subproject name
afterEvaluate {
task sourceJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
publishing {
publications {
// We need this check to cover Android Studio gradle sync
if(project.tasks.findByPath('bundleRelease') != null) {
maven(MavenPublication) {
artifact bundleRelease
artifactId project.artifactId
artifact sourceJar
pom.withXml {
// HACK to add dependencies to POM.
// When maven-publish can do this automatically for Android projects,
// remove this section.
def deps = asNode().appendNode('dependencies')
project.configurations.compile.allDependencies.each { dep ->
def node = deps.appendNode('dependency')
node.appendNode('groupId', dep.group)
node.appendNode('artifactId', dep.name)
node.appendNode('version', dep.version)
node.appendNode('scope', 'compile')
}
}
}
}
}
}
if(project.hasProperty('bintray_user') && project.hasProperty('bintray_key')) {
bintray {
user = bintray_user
key = bintray_key
publications = ['maven']
publish = true
pkg {
userOrg = 'journeyapps'
repo = 'maven'
name = 'zxing-android-embedded'
}
}
}
}
}
ext.androidTargetSdk = 30
ext.zxingCore = 'com.google.zxing:core:3.4.1'
}
+3
View File
@@ -0,0 +1,3 @@
android.enableJetifier=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
Binary file not shown.
+1 -2
View File
@@ -1,6 +1,5 @@
#Sat Dec 20 18:56:59 SAST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Vendored
+83 -64
View File
@@ -1,4 +1,20 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
@@ -6,47 +22,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -90,7 +105,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,10 +125,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -138,27 +154,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
Vendored
+100
View File
@@ -0,0 +1,100 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
-1
View File
@@ -1 +0,0 @@
/build
-18
View File
@@ -1,18 +0,0 @@
apply plugin: 'com.android.library'
ext.artifactId = 'zxing-android-integration'
android {
compileSdkVersion project.androidTargetSdk
buildToolsVersion project.androidBuildTools
defaultConfig {
minSdkVersion 8
targetSdkVersion project.androidTargetSdk
}
}
dependencies {
// Optional dependency.
provided 'com.android.support:support-v4:21.0.3'
}
-7
View File
@@ -1,7 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.embarkmobile.zxing.integration">
<application>
</application>
</manifest>
@@ -1,477 +0,0 @@
/*
* Copyright 2009 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.integration.android;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Display;
import android.view.WindowManager;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>A utility class which helps ease integration with Barcode Scanner via {@link Intent}s. This is a simple
* way to invoke barcode scanning and receive the result, without any need to integrate, modify, or learn the
* project's source code.</p>
*
* <h2>Initiating a barcode scan</h2>
*
* <p>To integrate, create an instance of {@code IntentIntegrator} and call {@link #initiateScan()} and wait
* for the result in your app.</p>
*
* <p>It does require that the Barcode Scanner (or work-alike) application is installed. The
* {@link #initiateScan()} method will prompt the user to download the application, if needed.</p>
*
* <p>There are a few steps to using this integration. First, your {@link Activity} must implement
* the method {@link Activity#onActivityResult(int, int, Intent)} and include a line of code like this:</p>
*
* <pre>{@code
* public void onActivityResult(int requestCode, int resultCode, Intent intent) {
* IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
* if (scanResult != null) {
* // handle scan result
* }
* // else continue with any other code you need in the method
* ...
* }
* }</pre>
*
* <p>This is where you will handle a scan result.</p>
*
* <p>Second, just call this in response to a user action somewhere to begin the scan process:</p>
*
* <pre>{@code
* IntentIntegrator integrator = new IntentIntegrator(yourActivity);
* integrator.initiateScan();
* }</pre>
*
* <p>Finally, you can use {@link #addExtra(String, Object)} to add more parameters to the Intent used
* to invoke the scanner. This can be used to set additional options not directly exposed by this
* simplified API.</p>
*
* <h2>Sharing text via barcode</h2>
*
* <p>To share text, encoded as a QR Code on-screen, similarly, see {@link #shareText(CharSequence)}.</p>
*
* <p>Some code, particularly download integration, was contributed from the Anobiit application.</p>
*
* <h2>Enabling experimental barcode formats</h2>
*
* <p>Some formats are not enabled by default even when scanning with {@link #ALL_CODE_TYPES}, such as
* PDF417. Use {@link #initiateScan(java.util.Collection)} with
* a collection containing the names of formats to scan for explicitly, like "PDF_417", to use such
* formats.</p>
*
* @author Sean Owen
* @author Fred Lin
* @author Isaac Potoczny-Jones
* @author Brad Drehmer
* @author gcstang
*/
public class IntentIntegrator {
public static final int REQUEST_CODE = 0x0000c0de; // Only use bottom 16 bits
private static final String TAG = IntentIntegrator.class.getSimpleName();
// supported barcode formats
public static final Collection<String> PRODUCT_CODE_TYPES = list("UPC_A", "UPC_E", "EAN_8", "EAN_13", "RSS_14");
public static final Collection<String> ONE_D_CODE_TYPES =
list("UPC_A", "UPC_E", "EAN_8", "EAN_13", "CODE_39", "CODE_93", "CODE_128",
"ITF", "RSS_14", "RSS_EXPANDED");
public static final Collection<String> QR_CODE_TYPES = Collections.singleton("QR_CODE");
public static final Collection<String> DATA_MATRIX_TYPES = Collections.singleton("DATA_MATRIX");
public static final Collection<String> ALL_CODE_TYPES = null;
private final Activity activity;
private android.app.Fragment fragment;
private android.support.v4.app.Fragment supportFragment;
private final Map<String,Object> moreExtras = new HashMap<String,Object>(3);
private Collection<String> desiredBarcodeFormats;
private static final boolean HAVE_STANDARD_SCANNER;
private static final boolean HAVE_LEGACY_SCANNER;
private static final String STANDARD_PACKAGE_NAME = "com.google.zxing.client.android";
private static final String LEGACY_PACKAGE_NAME = "com.google.zxing.client.androidlegacy";
protected Class<?> getCaptureActivity() {
try {
return Class.forName(getScannerPackage() + ".CaptureActivity");
} catch (ClassNotFoundException e) {
throw new RuntimeException("Could not find CaptureActivity. Make sure one of the zxing-android libraries are loaded.", e);
}
}
private static String getScannerPackage() {
if(HAVE_STANDARD_SCANNER && Build.VERSION.SDK_INT >= 15) {
return STANDARD_PACKAGE_NAME;
} else if(HAVE_LEGACY_SCANNER) {
return LEGACY_PACKAGE_NAME;
} else {
return STANDARD_PACKAGE_NAME;
}
}
static {
boolean test1 = false;
try {
Class.forName(STANDARD_PACKAGE_NAME + ".CaptureActivity");
test1 = true;
} catch (ClassNotFoundException e) {
// Ignore
}
HAVE_STANDARD_SCANNER = test1;
boolean test2 = false;
try {
Class.forName(LEGACY_PACKAGE_NAME + ".CaptureActivity");
test2 = true;
} catch (ClassNotFoundException e) {
// Ignore
}
HAVE_LEGACY_SCANNER = test2;
}
/**
* @param activity {@link Activity} invoking the integration
*/
public IntentIntegrator(Activity activity) {
this.activity = activity;
}
/**
* @param fragment {@link Fragment} invoking the integration.
* {@link #startActivityForResult(Intent, int)} will be called on the {@link Fragment} instead
* of an {@link Activity}
*/
public static IntentIntegrator forSupportFragment(android.support.v4.app.Fragment fragment) {
IntentIntegrator integrator = new IntentIntegrator(fragment.getActivity());
integrator.supportFragment = fragment;
return integrator;
}
/**
* @param fragment {@link Fragment} invoking the integration.
* {@link #startActivityForResult(Intent, int)} will be called on the {@link Fragment} instead
* of an {@link Activity}
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static IntentIntegrator forFragment(Fragment fragment) {
IntentIntegrator integrator = new IntentIntegrator(fragment.getActivity());
integrator.fragment = fragment;
return integrator;
}
public Map<String,?> getMoreExtras() {
return moreExtras;
}
public final IntentIntegrator addExtra(String key, Object value) {
moreExtras.put(key, value);
return this;
}
/**
* Change the layout used for scanning in zxing-android.
*
* @param resourceId the layout resource id to use.
*/
public final IntentIntegrator setCaptureLayout(int resourceId) {
addExtra("ZXING_CAPTURE_LAYOUT_ID_KEY", resourceId);
return this;
}
/**
* Change the layout used for scanning in zxing-android-legacy.
*
* @param resourceId the layout resource id to use.
*/
public final IntentIntegrator setLegacyCaptureLayout(int resourceId) {
addExtra("ZXINGLEGACY_CAPTURE_LAYOUT_ID_KEY", resourceId);
return this;
}
/**
* Set a prompt to display on the capture screen, instead of using the default.
*
* @param prompt the prompt to display
*/
public final IntentIntegrator setPrompt(String prompt) {
if (prompt != null) {
addExtra("PROMPT_MESSAGE", prompt);
}
return this;
}
/**
* Set the duration that the result should be displayed after scanning.
*
* @param ms time to display the result in ms
*/
public final IntentIntegrator setResultDisplayDuration(long ms) {
addExtra("RESULT_DISPLAY_DURATION_MS", ms);
return this;
}
/**
* Set the size of the scanning rectangle.
*
* @param desiredWidth the desired width in pixels
* @param desiredHeight the desired height in pixels
*/
public final IntentIntegrator setScanningRectangle(int desiredWidth, int desiredHeight) {
addExtra("SCAN_WIDTH", desiredWidth);
addExtra("SCAN_HEIGHT", desiredHeight);
return this;
}
/**
* Use a wide scanning rectangle.
*
* May work better for 1D barcodes.
*/
public void setWide() {
WindowManager window = activity.getWindowManager();
Display display = window.getDefaultDisplay();
int displayWidth = display.getWidth();
int displayHeight = display.getHeight();
if (displayHeight > displayWidth) {
// This is portrait dimensions, but the barcode scanner is always in landscape mode.
int temp = displayWidth;
//noinspection SuspiciousNameCombination
displayWidth = displayHeight;
displayHeight = temp;
}
int desiredWidth = displayWidth * 9 / 10;
int desiredHeight = Math.min(displayHeight * 3 / 4, 400); // Limit to 400px
setScanningRectangle(desiredWidth, desiredHeight);
}
/**
* Heuristics for whether or not the barcode scanning rectangle should be wide or not.
*
* Current heuristics make it wide if 1D barcode formats are scanned, and no QR codes.
*
* @param desiredBarcodeFormats the formats that will be scanned
* @return true if it should be wide
*/
public static boolean shouldBeWide(Collection<String> desiredBarcodeFormats) {
boolean scan1d = false;
boolean scan2d = false;
for (String format : desiredBarcodeFormats) {
if(ONE_D_CODE_TYPES.contains(format)) {
scan1d = true;
}
if(QR_CODE_TYPES.contains(format) || DATA_MATRIX_TYPES.contains(format)) {
scan2d = true;
}
}
return scan1d && !scan2d;
}
/**
* Make the scanning rectangle wide if only 1D barcodes are scanned.
*
* This must be called *after* setting the desired barcode formats.
*
* @return this
*/
public IntentIntegrator autoWide() {
if(desiredBarcodeFormats != null && shouldBeWide(desiredBarcodeFormats)) {
setWide();
}
return this;
}
/**
* Use the specified camera ID to scan barcodes.
*
* @param cameraId camera ID of the camera to use. A negative value means "no preference".
* @return this
*/
public IntentIntegrator setCameraId(int cameraId) {
if (cameraId >= 0) {
addExtra("SCAN_CAMERA_ID", cameraId);
}
return this;
}
/**
* Set the desired barcode formats to scan.
*
* @param desiredBarcodeFormats names of {@code BarcodeFormat}s to scan for
* @return this
*/
public IntentIntegrator setDesiredBarcodeFormats(Collection<String> desiredBarcodeFormats) {
this.desiredBarcodeFormats = desiredBarcodeFormats;
return this;
}
/**
* Initiates a scan for all known barcode types with the default camera.
*/
public final void initiateScan() {
startActivityForResult(createScanIntent(), REQUEST_CODE);
}
/**
* Create an scan intent with the specified options.
*
* @return the intent
*/
public Intent createScanIntent() {
Intent intentScan = new Intent(activity, getCaptureActivity());
intentScan.setAction("com.google.zxing.client.android.SCAN");
// check which types of codes to scan for
if (desiredBarcodeFormats != null) {
// set the desired barcode types
StringBuilder joinedByComma = new StringBuilder();
for (String format : desiredBarcodeFormats) {
if (joinedByComma.length() > 0) {
joinedByComma.append(',');
}
joinedByComma.append(format);
}
intentScan.putExtra("SCAN_FORMATS", joinedByComma.toString());
}
intentScan.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intentScan.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
attachMoreExtras(intentScan);
return intentScan;
}
/**
* Initiates a scan, only for a certain set of barcode types, given as strings corresponding
* to their names in ZXing's {@code BarcodeFormat} class like "UPC_A". You can supply constants
* like {@link #PRODUCT_CODE_TYPES} for example.
*
* @param desiredBarcodeFormats names of {@code BarcodeFormat}s to scan for
*/
public final void initiateScan(Collection<String> desiredBarcodeFormats) {
setDesiredBarcodeFormats(desiredBarcodeFormats);
initiateScan();
}
/**
* Start an activity. This method is defined to allow different methods of activity starting for
* newer versions of Android and for compatibility library.
*
* @param intent Intent to start.
* @param code Request code for the activity
* @see android.app.Activity#startActivityForResult(Intent, int)
* @see android.app.Fragment#startActivityForResult(Intent, int)
*/
protected void startActivityForResult(Intent intent, int code) {
if (fragment != null) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
fragment.startActivityForResult(intent, code);
}
} else if(supportFragment != null) {
supportFragment.startActivityForResult(intent, code);
} else {
activity.startActivityForResult(intent, code);
}
}
protected void startActivity(Intent intent) {
if (fragment != null) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
fragment.startActivity(intent);
}
} else if(supportFragment != null) {
supportFragment.startActivity(intent);
} else {
activity.startActivity(intent);
}
}
/**
* <p>Call this from your {@link Activity}'s
* {@link Activity#onActivityResult(int, int, Intent)} method.</p>
*
* @param requestCode request code from {@code onActivityResult()}
* @param resultCode result code from {@code onActivityResult()}
* @param intent {@link Intent} from {@code onActivityResult()}
* @return null if the event handled here was not related to this class, or
* else an {@link IntentResult} containing the result of the scan. If the user cancelled scanning,
* the fields will be null.
*/
public static IntentResult parseActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
String contents = intent.getStringExtra("SCAN_RESULT");
String formatName = intent.getStringExtra("SCAN_RESULT_FORMAT");
byte[] rawBytes = intent.getByteArrayExtra("SCAN_RESULT_BYTES");
int intentOrientation = intent.getIntExtra("SCAN_RESULT_ORIENTATION", Integer.MIN_VALUE);
Integer orientation = intentOrientation == Integer.MIN_VALUE ? null : intentOrientation;
String errorCorrectionLevel = intent.getStringExtra("SCAN_RESULT_ERROR_CORRECTION_LEVEL");
return new IntentResult(contents,
formatName,
rawBytes,
orientation,
errorCorrectionLevel);
}
return new IntentResult();
}
return null;
}
private static List<String> list(String... values) {
return Collections.unmodifiableList(Arrays.asList(values));
}
private void attachMoreExtras(Intent intent) {
for (Map.Entry<String,Object> entry : moreExtras.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
// Kind of hacky
if (value instanceof Integer) {
intent.putExtra(key, (Integer) value);
} else if (value instanceof Long) {
intent.putExtra(key, (Long) value);
} else if (value instanceof Boolean) {
intent.putExtra(key, (Boolean) value);
} else if (value instanceof Double) {
intent.putExtra(key, (Double) value);
} else if (value instanceof Float) {
intent.putExtra(key, (Float) value);
} else if (value instanceof Bundle) {
intent.putExtra(key, (Bundle) value);
} else {
intent.putExtra(key, value.toString());
}
}
}
}
-1
View File
@@ -1 +0,0 @@
/build
-26
View File
@@ -1,26 +0,0 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion project.androidTargetSdk
buildToolsVersion project.androidBuildTools
defaultConfig {
minSdkVersion 11
targetSdkVersion project.androidTargetSdk
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile(project(':zxing-android')) { transitive = true }
compile(project(':zxing-android-legacy')) { transitive = true }
compile(project(':integration'))
}
-17
View File
@@ -1,17 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/ralf/apps/android-studio/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="example.zxing" >
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name" >
<activity
android:name="example.zxing.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -1,108 +0,0 @@
package example.zxing;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void scanBarcode(View view) {
new IntentIntegrator((Activity)this).initiateScan();
}
public void scanBarcodeCustomOptions(View view) {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
integrator.autoWide();
integrator.initiateScan();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
} else {
// This is important, otherwise the result will not be passed to the fragment
super.onActivityResult(requestCode, resultCode, data);
}
}
/**
* Sample of scanning from a Fragment
*/
public static class ScanFragment extends Fragment {
private String toast;
public ScanFragment() {
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
displayToast();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scan, container, false);
Button scan = (Button) view.findViewById(R.id.scan_from_fragment);
scan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scanFromFragment();
}
});
return view;
}
public void scanFromFragment() {
IntentIntegrator.forFragment(this).initiateScan();
}
private void displayToast() {
if(getActivity() != null && toast != null) {
Toast.makeText(getActivity(), toast, Toast.LENGTH_LONG).show();
toast = null;
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
toast = "Cancelled from fragment";
} else {
toast = "Scanned from fragment: " + result.getContents();
}
// At this point we may or may not have a reference to the activity
displayToast();
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,33 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="example.zxing.MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scan_barcode"
android:onClick="scanBarcode"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/custom_options"
android:onClick="scanBarcodeCustomOptions"/>
<fragment
android:tag="scan_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="example.zxing.MainActivity$ScanFragment" tools:layout="@layout/fragment_scan" />
</LinearLayout>
@@ -1,16 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="example.zxing.MainActivity"
tools:showIn="@layout/activity_main">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scan_from_fragment"
android:id="@+id/scan_from_fragment"/>
</LinearLayout>
@@ -1,6 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ZXing Sample</string>
<string name="scan_barcode">Scan Barcode</string>
<string name="custom_options">Custom Options</string>
<string name="scan_from_fragment">Scan from fragment</string>
</resources>
@@ -1,8 +0,0 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme">
</style>
</resources>
-1
View File
@@ -1 +0,0 @@
/build
+71 -8
View File
@@ -2,25 +2,88 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion project.androidTargetSdk
buildToolsVersion project.androidBuildTools
defaultConfig {
minSdkVersion 9
multiDexEnabled true
minSdkVersion 19
targetSdkVersion project.androidTargetSdk
versionCode 1
versionName "1.0"
versionCode 411
versionName "4.1.1"
}
def validConfig
def keystoreFile
def keystorePassword
def keystoreAlias
try {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
keystoreFile = properties.getProperty('keystore.file')
keystorePassword = properties.getProperty('keystore.password')
keystoreAlias = properties.getProperty('keystore.alias')
validConfig = keystoreFile != null && keystorePassword != null && keystoreAlias != null
} catch (error) {
validConfig = false
}
if (validConfig) {
System.out.println("Release signing configured with " + keystoreFile)
signingConfigs {
release {
storeFile project.rootProject.file(keystoreFile)
storePassword keystorePassword
keyAlias keystoreAlias
keyPassword keystorePassword
}
}
} else {
System.out.println("Specify keystore.file, keystore.alias and keystore.password in local.properties to enable release signing.")
}
buildTypes {
release {
if (validConfig) {
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
// Error: The lint detector
// androidx.appcompat.view.OnClickXmlDetector
// called context.getMainProject() during module analysis.
disable 'UsingOnClickInXml'
}
}
dependencies {
compile(project(':zxing-android')) { transitive = true }
compile(project(':zxing-android-legacy')) { transitive = true }
compile(project(':integration'))
compile 'com.android.support:appcompat-v7:21.0.3'
// If you use this from an external project, use the following instead:
// implementation 'com.journeyapps:zxing-android-embedded:<version>'
implementation project(':zxing-android-embedded')
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation "androidx.activity:activity:1.3.1"
// Desugaring and multidex is required for API < 21.
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation 'androidx.multidex:multidex:2.0.1'
// leakcanary is for development purposes only
// https://github.com/square/leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
// AboutLibraries
implementation 'com.mikepenz:aboutlibraries:6.2.3'
}
+37 -6
View File
@@ -1,21 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="example.zxing" >
package="example.zxing">
<application
android:allowBackup="true"
android:name=".SampleApplication"
android:allowBackup="false"
android:icon="@drawable/icon"
android:label="@string/app_name" >
android:label="@string/app_name">
<activity
android:name="example.zxing.MainActivity"
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ContinuousCaptureActivity"></activity>
<activity
android:name=".AnyOrientationCaptureActivity"
android:screenOrientation="fullSensor"
android:stateNotNeeded="true"
android:theme="@style/zxing_CaptureTheme"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
<activity
android:name=".ToolbarCaptureActivity"
android:clearTaskOnLaunch="true"
android:screenOrientation="portrait"
android:stateNotNeeded="true"
android:theme="@style/AppCompatCaptureTheme"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
<activity
android:name=".CustomScannerActivity"
android:screenOrientation="fullSensor"
android:stateNotNeeded="true"
android:theme="@style/zxing_CaptureTheme"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
<activity
android:name=".SmallCaptureActivity"
android:screenOrientation="fullSensor"
android:stateNotNeeded="true"
android:theme="@style/zxing_CaptureTheme"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
<activity
android:name=".TabbedScanning"
android:theme="@style/Theme.AppCompat"
android:label="@string/title_activity_tabbed_scanning"></activity>
</application>
</manifest>
</manifest>
@@ -0,0 +1,11 @@
package example.zxing;
import com.journeyapps.barcodescanner.CaptureActivity;
/**
* This Activity is exactly the same as CaptureActivity, but has a different orientation
* setting in AndroidManifest.xml.
*/
public class AnyOrientationCaptureActivity extends CaptureActivity {
}
@@ -0,0 +1,99 @@
package example.zxing;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.ResultPoint;
import com.google.zxing.client.android.BeepManager;
import com.journeyapps.barcodescanner.BarcodeCallback;
import com.journeyapps.barcodescanner.BarcodeResult;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.DefaultDecoderFactory;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* This sample performs continuous scanning, displaying the barcode and source image whenever
* a barcode is scanned.
*/
public class ContinuousCaptureActivity extends Activity {
private DecoratedBarcodeView barcodeView;
private BeepManager beepManager;
private String lastText;
private BarcodeCallback callback = new BarcodeCallback() {
@Override
public void barcodeResult(BarcodeResult result) {
if(result.getText() == null || result.getText().equals(lastText)) {
// Prevent duplicate scans
return;
}
lastText = result.getText();
barcodeView.setStatusText(result.getText());
beepManager.playBeepSoundAndVibrate();
//Added preview of scanned barcode
ImageView imageView = findViewById(R.id.barcodePreview);
imageView.setImageBitmap(result.getBitmapWithResultPoints(Color.YELLOW));
}
@Override
public void possibleResultPoints(List<ResultPoint> resultPoints) {
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.continuous_scan);
barcodeView = findViewById(R.id.barcode_scanner);
Collection<BarcodeFormat> formats = Arrays.asList(BarcodeFormat.QR_CODE, BarcodeFormat.CODE_39);
barcodeView.getBarcodeView().setDecoderFactory(new DefaultDecoderFactory(formats));
barcodeView.initializeFromIntent(getIntent());
barcodeView.decodeContinuous(callback);
beepManager = new BeepManager(this);
}
@Override
protected void onResume() {
super.onResume();
barcodeView.resume();
}
@Override
protected void onPause() {
super.onPause();
barcodeView.pause();
}
public void pause(View view) {
barcodeView.pause();
}
public void resume(View view) {
barcodeView.resume();
}
public void triggerScan(View view) {
barcodeView.decodeSingle(callback);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return barcodeView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
}
@@ -0,0 +1,127 @@
package example.zxing;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.ViewfinderView;
import java.util.Random;
/**
* Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
*/
public class CustomScannerActivity extends Activity implements
DecoratedBarcodeView.TorchListener {
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
private Button switchFlashlightButton;
private ViewfinderView viewfinderView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_scanner);
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
barcodeScannerView.setTorchListener(this);
switchFlashlightButton = findViewById(R.id.switch_flashlight);
viewfinderView = findViewById(R.id.zxing_viewfinder_view);
// if the device does not have flashlight in its camera,
// then remove the switch flashlight button...
if (!hasFlash()) {
switchFlashlightButton.setVisibility(View.GONE);
}
capture = new CaptureManager(this, barcodeScannerView);
capture.initializeFromIntent(getIntent(), savedInstanceState);
capture.setShowMissingCameraPermissionDialog(false);
capture.decode();
changeMaskColor(null);
changeLaserVisibility(true);
}
@Override
protected void onResume() {
super.onResume();
capture.onResume();
}
@Override
protected void onPause() {
super.onPause();
capture.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
capture.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
capture.onSaveInstanceState(outState);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
/**
* Check if the device's camera has a Flashlight.
* @return true if there is Flashlight, otherwise false.
*/
private boolean hasFlash() {
return getApplicationContext().getPackageManager()
.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
}
public void switchFlashlight(View view) {
if (getString(R.string.turn_on_flashlight).equals(switchFlashlightButton.getText())) {
barcodeScannerView.setTorchOn();
} else {
barcodeScannerView.setTorchOff();
}
}
public void changeMaskColor(View view) {
Random rnd = new Random();
int color = Color.argb(100, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
viewfinderView.setMaskColor(color);
}
public void changeLaserVisibility(boolean visible) {
viewfinderView.setLaserVisibility(visible);
}
@Override
public void onTorchOn() {
switchFlashlightButton.setText(R.string.turn_off_flashlight);
}
@Override
public void onTorchOff() {
switchFlashlightButton.setText(R.string.turn_on_flashlight);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
@@ -3,19 +3,41 @@ package example.zxing;
import android.content.Intent;
import android.hardware.Camera;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.google.zxing.client.android.Intents;
import com.journeyapps.barcodescanner.ScanContract;
import com.journeyapps.barcodescanner.ScanOptions;
import com.mikepenz.aboutlibraries.LibsBuilder;
import androidx.activity.result.ActivityResultLauncher;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
public class MainActivity extends ActionBarActivity {
public class MainActivity extends AppCompatActivity {
private final ActivityResultLauncher<ScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(),
result -> {
if(result.getContents() == null) {
Intent originalIntent = result.getOriginalIntent();
if (originalIntent == null) {
Log.d("MainActivity", "Cancelled scan");
Toast.makeText(MainActivity.this, "Cancelled", Toast.LENGTH_LONG).show();
} else if(originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
Log.d("MainActivity", "Cancelled scan due to missing camera permission");
Toast.makeText(MainActivity.this, "Cancelled due to missing camera permission", Toast.LENGTH_LONG).show();
}
} else {
Log.d("MainActivity", "Scanned");
Toast.makeText(MainActivity.this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
});
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -24,94 +46,111 @@ public class MainActivity extends ActionBarActivity {
}
public void scanBarcode(View view) {
new IntentIntegrator(this).initiateScan();
barcodeLauncher.launch(new ScanOptions());
}
public void scanBarcodeInverted(View view){
ScanOptions options = new ScanOptions();
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
barcodeLauncher.launch(options);
}
public void scanMixedBarcodes(View view){
ScanOptions options = new ScanOptions();
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN);
barcodeLauncher.launch(options);
}
public void scanBarcodeCustomLayout(View view) {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCaptureLayout(R.layout.custom_capture_layout);
integrator.setLegacyCaptureLayout(R.layout.custom_legacy_capture_layout);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
integrator.autoWide();
integrator.initiateScan();
ScanOptions options = new ScanOptions();
options.setCaptureActivity(AnyOrientationCaptureActivity.class);
options.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);
options.setPrompt("Scan something");
options.setOrientationLocked(false);
options.setBeepEnabled(false);
barcodeLauncher.launch(options);
}
public void scanPDF417(View view) {
ScanOptions options = new ScanOptions();
options.setDesiredBarcodeFormats(ScanOptions.PDF_417);
options.setPrompt("Scan something");
options.setOrientationLocked(false);
options.setBeepEnabled(false);
barcodeLauncher.launch(options);
}
public void scanBarcodeFrontCamera(View view) {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCameraId(Camera.CameraInfo.CAMERA_FACING_FRONT);
integrator.initiateScan();
ScanOptions options = new ScanOptions();
options.setCameraId(Camera.CameraInfo.CAMERA_FACING_FRONT);
barcodeLauncher.launch(options);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
} else {
// This is important, otherwise the result will not be passed to the fragment
super.onActivityResult(requestCode, resultCode, data);
}
public void scanContinuous(View view) {
Intent intent = new Intent(this, ContinuousCaptureActivity.class);
startActivity(intent);
}
public void scanToolbar(View view) {
ScanOptions options = new ScanOptions().setCaptureActivity(ToolbarCaptureActivity.class);
barcodeLauncher.launch(options);
}
public void scanCustomScanner(View view) {
ScanOptions options = new ScanOptions().setOrientationLocked(false).setCaptureActivity(CustomScannerActivity.class);
barcodeLauncher.launch(options);
}
public void scanMarginScanner(View view) {
ScanOptions options = new ScanOptions();
options.setOrientationLocked(false);
options.setCaptureActivity(SmallCaptureActivity.class);
barcodeLauncher.launch(options);
}
public void scanWithTimeout(View view) {
ScanOptions options = new ScanOptions();
options.setTimeout(8000);
barcodeLauncher.launch(options);
}
public void tabs(View view) {
Intent intent = new Intent(this, TabbedScanning.class);
startActivity(intent);
}
public void about(View view) {
new LibsBuilder().start(this);
}
/**
* Sample of scanning from a Fragment
*/
public static class ScanFragment extends Fragment {
private String toast;
private final ActivityResultLauncher<ScanOptions> fragmentLauncher = registerForActivityResult(new ScanContract(),
result -> {
if(result.getContents() == null) {
Toast.makeText(getContext(), "Cancelled from fragment", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getContext(), "Scanned from fragment: " + result.getContents(), Toast.LENGTH_LONG).show();
}
});
public ScanFragment() {
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
displayToast();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scan, container, false);
Button scan = (Button) view.findViewById(R.id.scan_from_fragment);
scan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scanFromFragment();
}
});
Button scan = view.findViewById(R.id.scan_from_fragment);
scan.setOnClickListener(v -> scanFromFragment());
return view;
}
public void scanFromFragment() {
IntentIntegrator.forSupportFragment(this).initiateScan();
}
private void displayToast() {
if(getActivity() != null && toast != null) {
Toast.makeText(getActivity(), toast, Toast.LENGTH_LONG).show();
toast = null;
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
toast = "Cancelled from fragment";
} else {
toast = "Scanned from fragment: " + result.getContents();
}
// At this point we may or may not have a reference to the activity
displayToast();
}
fragmentLauncher.launch(new ScanOptions());
}
}
}
@@ -0,0 +1,13 @@
package example.zxing;
import androidx.multidex.MultiDexApplication;
/**
*
*/
public class SampleApplication extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
}
}
@@ -0,0 +1,15 @@
package example.zxing;
import com.journeyapps.barcodescanner.CaptureActivity;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
/**
* This activity has a margin.
*/
public class SmallCaptureActivity extends CaptureActivity {
@Override
protected DecoratedBarcodeView initializeContent() {
setContentView(R.layout.capture_small);
return (DecoratedBarcodeView)findViewById(R.id.zxing_barcode_scanner);
}
}
@@ -0,0 +1,236 @@
package example.zxing;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentTransaction;
import androidx.legacy.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.journeyapps.barcodescanner.CameraPreview;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
public class TabbedScanning extends AppCompatActivity implements ActionBar.TabListener {
/**
* The {@link PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link FragmentStatePagerAdapter}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tabbed_scanning);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
// Set up the action bar.
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// When swiping between different sections, select the corresponding
// tab. We can also use ActionBar.Tab#select() to do this if we have
// a reference to the Tab.
mViewPager.setOffscreenPageLimit(0);
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
actionBar.setSelectedNavigationItem(position);
}
});
// For each of the sections in the app, add a tab to the action bar.
for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
// Create a tab with text corresponding to the page title defined by
// the adapter. Also specify this Activity object, which implements
// the TabListener interface, as the callback (listener) for when
// this tab is selected.
actionBar.addTab(
actionBar.newTab()
.setText(mSectionsPagerAdapter.getPageTitle(i))
.setTabListener(this));
}
}
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
// When the given tab is selected, switch to the corresponding page in
// the ViewPager.
mViewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
/**
* A placeholder fragment containing a simple view.
*/
public static class ScanFragment extends Fragment {
DecoratedBarcodeView barcodeView;
public ScanFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static ScanFragment newInstance() {
return new ScanFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_tabbed_scanning, container, false);
barcodeView = rootView.findViewById(R.id.barcode_view);
return rootView;
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(barcodeView != null) {
if (isVisibleToUser) {
barcodeView.resume();
} else {
barcodeView.pauseAndWait();
}
}
}
@Override
public void onPause() {
super.onPause();
barcodeView.pauseAndWait();
}
@Override
public void onResume() {
super.onResume();
barcodeView.resume();
}
}
/**
* A placeholder fragment containing a simple view.
*/
public static class CameraFragment extends Fragment {
private CameraPreview cameraPreview;
public CameraFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static CameraFragment newInstance() {
return new CameraFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_tabbed_camera, container, false);
cameraPreview = rootView.findViewById(R.id.camera_preview);
return rootView;
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (cameraPreview != null) {
if (isVisibleToUser) {
cameraPreview.resume();
} else {
cameraPreview.pauseAndWait();
}
}
}
@Override
public void onPause() {
super.onPause();
cameraPreview.pauseAndWait();
}
@Override
public void onResume() {
super.onResume();
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
if(position == 0) {
return ScanFragment.newInstance();
} else {
return CameraFragment.newInstance();
}
}
@Override
public int getCount() {
return 2;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "Scan";
case 1:
return "Camera";
}
return null;
}
}
}
@@ -0,0 +1,69 @@
package example.zxing;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.KeyEvent;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
/**
* Sample Activity extending from ActionBarActivity to display a Toolbar.
*/
public class ToolbarCaptureActivity extends AppCompatActivity {
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.capture_appcompat);
Toolbar toolbar = findViewById(R.id.my_awesome_toolbar);
toolbar.setTitle("Scan Barcode");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
capture = new CaptureManager(this, barcodeScannerView);
capture.initializeFromIntent(getIntent(), savedInstanceState);
capture.decode();
}
@Override
protected void onResume() {
super.onResume();
capture.onResume();
}
@Override
protected void onPause() {
super.onPause();
capture.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
capture.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
capture.onSaveInstanceState(outState);
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
}
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="example.zxing.CustomScannerActivity">
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:zxing_scanner_layout="@layout/custom_barcode_scanner">
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
<Button
android:id="@+id/switch_flashlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/turn_on_flashlight"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:onClick="switchFlashlight"/>
</RelativeLayout>
+97 -29
View File
@@ -1,38 +1,106 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="example.zxing.MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scan_barcode"
android:onClick="scanBarcode"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/custom_layout"
android:onClick="scanBarcodeCustomLayout"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/front_camera"
android:onClick="scanBarcodeFrontCamera"/>
<fragment
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin">
android:name="example.zxing.MainActivity$ScanFragment" tools:layout="@layout/fragment_scan" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scan_barcode"
android:onClick="scanBarcode"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scan PDF417"
android:onClick="scanPDF417"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scan Inverted"
android:onClick="scanBarcodeInverted"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scan Normal and Inverted"
android:onClick="scanMixedBarcodes"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/any_orientation"
android:onClick="scanBarcodeCustomLayout"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/front_camera"
android:onClick="scanBarcodeFrontCamera"/>
<fragment
android:id="@+id/fragment_scan"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="example.zxing.MainActivity$ScanFragment" tools:layout="@layout/fragment_scan" />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/custom_activity"
android:onClick="scanContinuous"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/toolbar_activity"
android:onClick="scanToolbar"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/custom_scanner"
android:onClick="scanCustomScanner"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scanner_with_margin"
android:onClick="scanMarginScanner"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/scanner_with_timeout"
android:onClick="scanWithTimeout"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tabs"
android:onClick="tabs"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about"
android:onClick="about"/>
</LinearLayout>
</ScrollView>
@@ -0,0 +1,6 @@
<androidx.viewpager.widget.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="example.zxing.TabbedScanning" />
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar"/>
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@+id/my_awesome_toolbar"
android:layout_alignParentBottom="true"
android:id="@+id/zxing_barcode_scanner"
app:zxing_use_texture_view="true"/>
<!-- Sample for a footer. Also add to DecoratedBarcodeView: android:layout_above="@+id/footer" -->
<!-- <TextView
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="150dp"
android:text="Footer"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/> -->
</RelativeLayout>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="150dp"
android:layout_marginBottom="150dp"
android:id="@+id/zxing_barcode_scanner"
app:zxing_use_texture_view="false"
app:zxing_preview_scaling_strategy="fitXY"/>
</RelativeLayout>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/barcode_scanner"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_above="@+id/buttonsLayout"
android:layout_alignParentTop="true">
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/buttonsLayout"
android:layout_toLeftOf="@+id/centerHorizont">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Pause"
android:onClick="pause" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Resume"
android:onClick="resume" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:id="@+id/centerHorizont" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/centerHorizont"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@id/buttonsLayout"
android:id="@+id/barcodePreview" />
</RelativeLayout>
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.journeyapps.barcodescanner.BarcodeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_barcode_surface"
app:zxing_framing_rect_width="250dp"
app:zxing_framing_rect_height="50dp"/>
<com.journeyapps.barcodescanner.ViewfinderView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_viewfinder_view"
app:zxing_possible_result_points="@color/zxing_custom_possible_result_points"
app:zxing_result_view="@color/zxing_custom_result_view"
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
app:zxing_viewfinder_laser_visibility="true"
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask"/>
<TextView
android:id="@+id/zxing_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/zxing_transparent"
android:text="@string/zxing_msg_default_status"
android:textColor="@color/zxing_status_text"/>
</merge>
@@ -1,221 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<SurfaceView android:id="@+id/zxing_preview_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<com.google.zxing.client.android.ViewfinderView
android:id="@+id/zxing_viewfinder_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<LinearLayout android:id="@+id/zxing_result_view"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/zxing_result_view"
android:visibility="gone"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/zxing_standard_padding">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="right|center_vertical">
<ImageView android:id="@+id/zxing_barcode_image_view"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:maxWidth="160dip"
android:maxHeight="160dip"
android:layout_marginBottom="@dimen/zxing_half_padding"
android:adjustViewBounds="true"
android:scaleType="centerInside"
tools:ignore="ContentDescription"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxing_msg_default_format"
android:textColor="@color/zxing_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxing_half_padding"/>
<TextView android:id="@+id/zxing_format_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxing_msg_default_type"
android:textColor="@color/zxing_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxing_half_padding"/>
<TextView android:id="@+id/zxing_type_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxing_msg_default_time"
android:textColor="@color/zxing_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxing_half_padding"/>
<TextView android:id="@+id/zxing_time_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:id="@+id/zxing_meta_text_view_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxing_msg_default_meta"
android:textColor="@color/zxing_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxing_half_padding"/>
<TextView android:id="@+id/zxing_meta_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_minor_text"/>
</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/zxing_contents_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_text"
android:textColorLink="@color/zxing_result_text"
android:textSize="22sp"
android:paddingLeft="12dip"
android:autoLink="web"
android:textIsSelectable="true"/>
<TextView android:id="@+id/zxing_contents_supplement_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxing_result_text"
android:textColorLink="@color/zxing_result_text"
android:paddingLeft="12dip"
android:autoLink="web"
android:textIsSelectable="true"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout android:id="@+id/zxing_result_button_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<Button style="@style/zxing_ResultButton"
android:visibility="gone"/>
<Button style="@style/zxing_ResultButton"
android:visibility="gone"/>
<Button style="@style/zxing_ResultButton"
android:visibility="gone"/>
<Button style="@style/zxing_ResultButton"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_gravity="bottom|center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/zxing_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/zxing_transparent"
android:text="@string/zxing_msg_default_status"
android:textColor="@color/zxing_status_text"/>
<Button android:id="@id/zxing_back_button"
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:height="60dp"
android:textAlignment="center"
android:layout_gravity="bottom|center_horizontal"
android:text="@string/zxing_button_cancel"/>
</LinearLayout>
</merge>
@@ -1,227 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<SurfaceView android:id="@+id/zxinglegacy_preview_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<com.google.zxing.client.androidlegacy.ViewfinderView
android:id="@+id/zxinglegacy_viewfinder_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<LinearLayout android:id="@+id/zxinglegacy_result_view"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/zxinglegacy_result_view"
android:visibility="gone"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/zxinglegacy_standard_padding">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="right|center_vertical">
<ImageView android:id="@+id/zxinglegacy_barcode_image_view"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:maxWidth="160dip"
android:maxHeight="160dip"
android:layout_marginBottom="@dimen/zxinglegacy_half_padding"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxinglegacy_msg_default_format"
android:textColor="@color/zxinglegacy_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxinglegacy_half_padding"/>
<TextView android:id="@+id/format_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxinglegacy_msg_default_type"
android:textColor="@color/zxinglegacy_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxinglegacy_half_padding"/>
<TextView android:id="@+id/zxinglegacy_type_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxinglegacy_msg_default_time"
android:textColor="@color/zxinglegacy_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxinglegacy_half_padding"/>
<TextView android:id="@+id/zxinglegacy_time_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_minor_text"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:id="@+id/meta_text_view_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zxinglegacy_msg_default_meta"
android:textColor="@color/zxinglegacy_result_minor_text"
android:textStyle="bold"
android:paddingRight="@dimen/zxinglegacy_half_padding"/>
<TextView android:id="@+id/zxinglegacy_meta_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_minor_text"/>
</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/zxinglegacy_contents_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_text"
android:textColorLink="@color/zxinglegacy_result_text"
android:textSize="22sp"
android:paddingLeft="12dip"
android:autoLink="web"/>
<TextView android:id="@+id/zxinglegacy_contents_supplement_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/zxinglegacy_result_text"
android:textColorLink="@color/zxinglegacy_result_text"
android:paddingLeft="12dip"
android:autoLink="web"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout android:id="@+id/zxinglegacy_result_button_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<Button android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"/>
<Button android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"/>
<Button android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"/>
<Button android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_gravity="bottom|center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/zxinglegacy_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/zxinglegacy_transparent"
android:text="@string/zxinglegacy_msg_default_status"
android:textColor="@color/zxinglegacy_status_text"/>
<Button android:id="@id/zxinglegacy_back_button"
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:height="60dp"
android:textAlignment="center"
android:layout_gravity="bottom|center_horizontal"
android:text="@string/zxinglegacy_button_cancel"/>
</LinearLayout>
</FrameLayout>
@@ -0,0 +1,17 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="example.zxing.TabbedScanning$CameraFragment">
<com.journeyapps.barcodescanner.CameraPreview
android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="300dp"
/>
</RelativeLayout>
@@ -0,0 +1,18 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="example.zxing.TabbedScanning$ScanFragment">
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/barcode_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
@@ -0,0 +1,4 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="example.zxing.TabbedScanning">
</menu>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppCompatCaptureTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#ffb341</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
+2 -1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
</resources>
+13 -2
View File
@@ -1,10 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">ZXing Sample</string>
<string name="scan_barcode">Scan Barcode</string>
<string name="custom_layout">Custom Layout</string>
<string name="scan_barcode_with_request_code">Scan Barcode with customized request code</string>
<string name="any_orientation">1D Any Orientation</string>
<string name="scan_from_fragment">Scan from fragment</string>
<string name="front_camera">Front Camera</string>
<string name="custom_activity">Continuous Scan</string>
<string name="toolbar_activity">Activity with Toolbar</string>
<string name="custom_scanner">Custom Scanner Activity</string>
<string name="scanner_with_margin">Scanner with Margin</string>
<string name="scanner_with_timeout">Finish Scan in 8 Seconds</string>
<string name="turn_on_flashlight">Turn on Flashlight</string>
<string name="turn_off_flashlight">Turn off Flashlight</string>
<string name="title_activity_tabbed_scanning">Tabbed Scanning</string>
<string name="tabs">Tabs</string>
<string name="about">About</string>
</resources>
+8 -1
View File
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
</style>
<style name="AppCompatCaptureTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="colorPrimary">#ffb341</item>
<item name="colorPrimaryDark">#ffb341</item>
<item name="colorAccent">#ffb341</item>
</style>
</resources>
+1 -5
View File
@@ -1,6 +1,2 @@
include ':zxing-android'
include ':zxing-android-complete'
include ':zxing-android-legacy'
include ':integration'
include ':zxing-android-embedded'
include ':sample'
include ':sample-nosupport'
-6
View File
@@ -1,6 +0,0 @@
target/
*.iml
bin/
gen/
libs/
local.properties
-106
View File
@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android"
>
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="21"/>
<!-- Don't require camera, as this requires a rear camera. This allows it to work on the Nexus 7 -->
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<!-- TODO replace above two with next line after Android 4.2 -->
<!-- <uses-feature android:name="android.hardware.camera.any"/> -->
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
<uses-feature android:name="android.hardware.screen.landscape"/>
<uses-feature android:name="android.hardware.wifi" android:required="false"/>
<!-- This excludes Google TV, which is unfortunately included by virtue of not requiring a camera -->
<uses-feature android:name="android.hardware.touchscreen"/>
<!-- TODO make this not required again after android.hardware.camera.any is available -->
<application android:icon="@drawable/zxing_launcher_icon"
android:logo="@drawable/zxing_launcher_icon"
android:label="@string/zxing_app_name"
android:allowBackup="true">
<activity android:name=".CaptureActivity"
android:screenOrientation="sensorLandscape"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/zxing_CaptureTheme"
android:windowSoftInputMode="stateAlwaysHidden">
<!-- Allow web apps to launch Barcode Scanner by linking to http://zxing.appspot.com/scan. -->
<!-- We also support a Google Product Search URL. -->
<!-- And the UK version. -->
<!-- Support zxing://scan/?... like iPhone app -->
</activity>
<activity android:name=".PreferencesActivity"
android:label="@string/zxing_preferences_name"
android:stateNotNeeded="true"/>
<activity android:name=".encode.EncodeActivity"
android:stateNotNeeded="true">
<!-- This allows us to handle the Share button in Contacts. -->
<!-- This allows us to handle sharing any plain text . -->
</activity>
<activity android:name=".book.SearchBookContentsActivity"
android:label="@string/zxing_sbc_name"
android:stateNotNeeded="true"
android:screenOrientation="sensorLandscape">
</activity>
<activity android:name=".share.ShareActivity"
android:stateNotNeeded="true"
android:screenOrientation="user">
</activity>
<activity android:name=".history.HistoryActivity"
android:label="@string/zxing_history_title"
android:stateNotNeeded="true"/>
<activity android:name=".share.BookmarkPickerActivity"
android:label="@string/zxing_bookmark_picker_name"
android:stateNotNeeded="true"/>
<activity android:name=".share.AppPickerActivity"
android:label="@string/zxing_app_picker_name"
android:stateNotNeeded="true"/>
<activity android:name=".HelpActivity"
android:label="@string/zxing_menu_help"
android:screenOrientation="user"
android:stateNotNeeded="true"/>
</application>
</manifest>
-16
View File
@@ -1,16 +0,0 @@
# zxing-android-complete
This is a complete copy of the ZXing Android application, converted to an Android library.
This is not intended to be used directly, but rather as a starting point to create a stripped-down
version.
`ruby update.rb` script does roughly the following:
1. Copy the Java source code, resources and assets from the ZXing Android application.
2. Prefix all resource files and names with `zxing_`.
3. Replace switch statements on resource ids with if statements.
4. Place assets in a `zxing` subfolder.
5. Update references in the Java code to all the renamed resources and assets.
6. Remove unwanted sections from AndroidManifest.xml.
7. Set minSdkVersion to 7.
@@ -1,447 +0,0 @@
/*
* Copyright (C) 2014 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.client.android.camera;
import android.annotation.TargetApi;
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.Camera;
import android.os.Build;
import android.util.Log;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
/**
* Utility methods for configuring the Android camera.
*
* @author Sean Owen
*/
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
public final class CameraConfigurationUtils {
private static final String TAG = "CameraConfiguration";
private static final Pattern SEMICOLON = Pattern.compile(";");
private static final int MIN_PREVIEW_PIXELS = 480 * 320; // normal screen
private static final float MAX_EXPOSURE_COMPENSATION = 1.5f;
private static final float MIN_EXPOSURE_COMPENSATION = 0.0f;
private static final double MAX_ASPECT_DISTORTION = 0.15;
private static final int MIN_FPS = 10;
private static final int MAX_FPS = 20;
private static final int AREA_PER_1000 = 400;
private CameraConfigurationUtils() {
}
public static void setFocus(Camera.Parameters parameters,
boolean autoFocus,
boolean disableContinuous,
boolean safeMode) {
List<String> supportedFocusModes = parameters.getSupportedFocusModes();
String focusMode = null;
if (autoFocus) {
if (safeMode || disableContinuous) {
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_AUTO);
} else {
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,
Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO,
Camera.Parameters.FOCUS_MODE_AUTO);
}
}
// Maybe selected auto-focus but not available, so fall through here:
if (!safeMode && focusMode == null) {
focusMode = findSettableValue("focus mode",
supportedFocusModes,
Camera.Parameters.FOCUS_MODE_MACRO,
Camera.Parameters.FOCUS_MODE_EDOF);
}
if (focusMode != null) {
if (focusMode.equals(parameters.getFocusMode())) {
Log.i(TAG, "Focus mode already set to " + focusMode);
} else {
parameters.setFocusMode(focusMode);
}
}
}
public static void setTorch(Camera.Parameters parameters, boolean on) {
List<String> supportedFlashModes = parameters.getSupportedFlashModes();
String flashMode;
if (on) {
flashMode = findSettableValue("flash mode",
supportedFlashModes,
Camera.Parameters.FLASH_MODE_TORCH,
Camera.Parameters.FLASH_MODE_ON);
} else {
flashMode = findSettableValue("flash mode",
supportedFlashModes,
Camera.Parameters.FLASH_MODE_OFF);
}
if (flashMode != null) {
if (flashMode.equals(parameters.getFlashMode())) {
Log.i(TAG, "Flash mode already set to " + flashMode);
} else {
Log.i(TAG, "Setting flash mode to " + flashMode);
parameters.setFlashMode(flashMode);
}
}
}
public static void setBestExposure(Camera.Parameters parameters, boolean lightOn) {
int minExposure = parameters.getMinExposureCompensation();
int maxExposure = parameters.getMaxExposureCompensation();
float step = parameters.getExposureCompensationStep();
if ((minExposure != 0 || maxExposure != 0) && step > 0.0f) {
// Set low when light is on
float targetCompensation = lightOn ? MIN_EXPOSURE_COMPENSATION : MAX_EXPOSURE_COMPENSATION;
int compensationSteps = Math.round(targetCompensation / step);
float actualCompensation = step * compensationSteps;
// Clamp value:
compensationSteps = Math.max(Math.min(compensationSteps, maxExposure), minExposure);
if (parameters.getExposureCompensation() == compensationSteps) {
Log.i(TAG, "Exposure compensation already set to " + compensationSteps + " / " + actualCompensation);
} else {
Log.i(TAG, "Setting exposure compensation to " + compensationSteps + " / " + actualCompensation);
parameters.setExposureCompensation(compensationSteps);
}
} else {
Log.i(TAG, "Camera does not support exposure compensation");
}
}
public static void setBestPreviewFPS(Camera.Parameters parameters) {
setBestPreviewFPS(parameters, MIN_FPS, MAX_FPS);
}
public static void setBestPreviewFPS(Camera.Parameters parameters, int minFPS, int maxFPS) {
List<int[]> supportedPreviewFpsRanges = parameters.getSupportedPreviewFpsRange();
Log.i(TAG, "Supported FPS ranges: " + toString(supportedPreviewFpsRanges));
if (supportedPreviewFpsRanges != null && !supportedPreviewFpsRanges.isEmpty()) {
int[] suitableFPSRange = null;
for (int[] fpsRange : supportedPreviewFpsRanges) {
int thisMin = fpsRange[Camera.Parameters.PREVIEW_FPS_MIN_INDEX];
int thisMax = fpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX];
if (thisMin >= minFPS * 1000 && thisMax <= maxFPS * 1000) {
suitableFPSRange = fpsRange;
break;
}
}
if (suitableFPSRange == null) {
Log.i(TAG, "No suitable FPS range?");
} else {
int[] currentFpsRange = new int[2];
parameters.getPreviewFpsRange(currentFpsRange);
if (Arrays.equals(currentFpsRange, suitableFPSRange)) {
Log.i(TAG, "FPS range already set to " + Arrays.toString(suitableFPSRange));
} else {
Log.i(TAG, "Setting FPS range to " + Arrays.toString(suitableFPSRange));
parameters.setPreviewFpsRange(suitableFPSRange[Camera.Parameters.PREVIEW_FPS_MIN_INDEX],
suitableFPSRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX]);
}
}
}
}
public static void setFocusArea(Camera.Parameters parameters) {
if (parameters.getMaxNumFocusAreas() > 0) {
Log.i(TAG, "Old focus areas: " + toString(parameters.getFocusAreas()));
List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000);
Log.i(TAG, "Setting focus area to : " + toString(middleArea));
parameters.setFocusAreas(middleArea);
} else {
Log.i(TAG, "Device does not support focus areas");
}
}
public static void setMetering(Camera.Parameters parameters) {
if (parameters.getMaxNumMeteringAreas() > 0) {
Log.i(TAG, "Old metering areas: " + parameters.getMeteringAreas());
List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000);
Log.i(TAG, "Setting metering area to : " + toString(middleArea));
parameters.setMeteringAreas(middleArea);
} else {
Log.i(TAG, "Device does not support metering areas");
}
}
private static List<Camera.Area> buildMiddleArea(int areaPer1000) {
return Collections.singletonList(
new Camera.Area(new Rect(-areaPer1000, -areaPer1000, areaPer1000, areaPer1000), 1));
}
public static void setVideoStabilization(Camera.Parameters parameters) {
if (parameters.isVideoStabilizationSupported()) {
if (parameters.getVideoStabilization()) {
Log.i(TAG, "Video stabilization already enabled");
} else {
Log.i(TAG, "Enabling video stabilization...");
parameters.setVideoStabilization(true);
}
} else {
Log.i(TAG, "This device does not support video stabilization");
}
}
public static void setBarcodeSceneMode(Camera.Parameters parameters) {
if (Camera.Parameters.SCENE_MODE_BARCODE.equals(parameters.getSceneMode())) {
Log.i(TAG, "Barcode scene mode already set");
return;
}
String sceneMode = findSettableValue("scene mode",
parameters.getSupportedSceneModes(),
Camera.Parameters.SCENE_MODE_BARCODE);
if (sceneMode != null) {
parameters.setSceneMode(sceneMode);
}
}
public static void setZoom(Camera.Parameters parameters, double targetZoomRatio) {
if (parameters.isZoomSupported()) {
Integer zoom = indexOfClosestZoom(parameters, targetZoomRatio);
if (zoom == null) {
return;
}
if (parameters.getZoom() == zoom) {
Log.i(TAG, "Zoom is already set to " + zoom);
} else {
Log.i(TAG, "Setting zoom to " + zoom);
parameters.setZoom(zoom);
}
} else {
Log.i(TAG, "Zoom is not supported");
}
}
private static Integer indexOfClosestZoom(Camera.Parameters parameters, double targetZoomRatio) {
List<Integer> ratios = parameters.getZoomRatios();
Log.i(TAG, "Zoom ratios: " + ratios);
int maxZoom = parameters.getMaxZoom();
if (ratios == null || ratios.isEmpty() || ratios.size() != maxZoom + 1) {
Log.w(TAG, "Invalid zoom ratios!");
return null;
}
double target100 = 100.0 * targetZoomRatio;
double smallestDiff = Double.POSITIVE_INFINITY;
int closestIndex = 0;
for (int i = 0; i < ratios.size(); i++) {
double diff = Math.abs(ratios.get(i) - target100);
if (diff < smallestDiff) {
smallestDiff = diff;
closestIndex = i;
}
}
Log.i(TAG, "Chose zoom ratio of " + (ratios.get(closestIndex) / 100.0));
return closestIndex;
}
public static void setInvertColor(Camera.Parameters parameters) {
if (Camera.Parameters.EFFECT_NEGATIVE.equals(parameters.getColorEffect())) {
Log.i(TAG, "Negative effect already set");
return;
}
String colorMode = findSettableValue("color effect",
parameters.getSupportedColorEffects(),
Camera.Parameters.EFFECT_NEGATIVE);
if (colorMode != null) {
parameters.setColorEffect(colorMode);
}
}
public static Point findBestPreviewSizeValue(Camera.Parameters parameters, Point screenResolution) {
List<Camera.Size> rawSupportedSizes = parameters.getSupportedPreviewSizes();
if (rawSupportedSizes == null) {
Log.w(TAG, "Device returned no supported preview sizes; using default");
Camera.Size defaultSize = parameters.getPreviewSize();
if (defaultSize == null) {
throw new IllegalStateException("Parameters contained no preview size!");
}
return new Point(defaultSize.width, defaultSize.height);
}
// Sort by size, descending
List<Camera.Size> supportedPreviewSizes = new ArrayList<>(rawSupportedSizes);
Collections.sort(supportedPreviewSizes, new Comparator<Camera.Size>() {
@Override
public int compare(Camera.Size a, Camera.Size b) {
int aPixels = a.height * a.width;
int bPixels = b.height * b.width;
if (bPixels < aPixels) {
return -1;
}
if (bPixels > aPixels) {
return 1;
}
return 0;
}
});
if (Log.isLoggable(TAG, Log.INFO)) {
StringBuilder previewSizesString = new StringBuilder();
for (Camera.Size supportedPreviewSize : supportedPreviewSizes) {
previewSizesString.append(supportedPreviewSize.width).append('x')
.append(supportedPreviewSize.height).append(' ');
}
Log.i(TAG, "Supported preview sizes: " + previewSizesString);
}
double screenAspectRatio = (double) screenResolution.x / (double) screenResolution.y;
// Remove sizes that are unsuitable
Iterator<Camera.Size> it = supportedPreviewSizes.iterator();
while (it.hasNext()) {
Camera.Size supportedPreviewSize = it.next();
int realWidth = supportedPreviewSize.width;
int realHeight = supportedPreviewSize.height;
if (realWidth * realHeight < MIN_PREVIEW_PIXELS) {
it.remove();
continue;
}
boolean isCandidatePortrait = realWidth < realHeight;
int maybeFlippedWidth = isCandidatePortrait ? realHeight : realWidth;
int maybeFlippedHeight = isCandidatePortrait ? realWidth : realHeight;
double aspectRatio = (double) maybeFlippedWidth / (double) maybeFlippedHeight;
double distortion = Math.abs(aspectRatio - screenAspectRatio);
if (distortion > MAX_ASPECT_DISTORTION) {
it.remove();
continue;
}
if (maybeFlippedWidth == screenResolution.x && maybeFlippedHeight == screenResolution.y) {
Point exactPoint = new Point(realWidth, realHeight);
Log.i(TAG, "Found preview size exactly matching screen size: " + exactPoint);
return exactPoint;
}
}
// If no exact match, use largest preview size. This was not a great idea on older devices because
// of the additional computation needed. We're likely to get here on newer Android 4+ devices, where
// the CPU is much more powerful.
if (!supportedPreviewSizes.isEmpty()) {
Camera.Size largestPreview = supportedPreviewSizes.get(0);
Point largestSize = new Point(largestPreview.width, largestPreview.height);
Log.i(TAG, "Using largest suitable preview size: " + largestSize);
return largestSize;
}
// If there is nothing at all suitable, return current preview size
Camera.Size defaultPreview = parameters.getPreviewSize();
if (defaultPreview == null) {
throw new IllegalStateException("Parameters contained no preview size!");
}
Point defaultSize = new Point(defaultPreview.width, defaultPreview.height);
Log.i(TAG, "No suitable preview sizes, using default: " + defaultSize);
return defaultSize;
}
private static String findSettableValue(String name,
Collection<String> supportedValues,
String... desiredValues) {
Log.i(TAG, "Requesting " + name + " value from among: " + Arrays.toString(desiredValues));
Log.i(TAG, "Supported " + name + " values: " + supportedValues);
if (supportedValues != null) {
for (String desiredValue : desiredValues) {
if (supportedValues.contains(desiredValue)) {
Log.i(TAG, "Can set " + name + " to: " + desiredValue);
return desiredValue;
}
}
}
Log.i(TAG, "No supported values match");
return null;
}
private static String toString(Collection<int[]> arrays) {
if (arrays == null || arrays.isEmpty()) {
return "[]";
}
StringBuilder buffer = new StringBuilder();
buffer.append('[');
Iterator<int[]> it = arrays.iterator();
while (it.hasNext()) {
buffer.append(Arrays.toString(it.next()));
if (it.hasNext()) {
buffer.append(", ");
}
}
buffer.append(']');
return buffer.toString();
}
private static String toString(Iterable<Camera.Area> areas) {
if (areas == null) {
return null;
}
StringBuilder result = new StringBuilder();
for (Camera.Area area : areas) {
result.append(area.rect).append(':').append(area.weight).append(' ');
}
return result.toString();
}
public static String collectStats(Camera.Parameters parameters) {
return collectStats(parameters.flatten());
}
public static String collectStats(CharSequence flattenedParams) {
StringBuilder result = new StringBuilder(1000);
result.append("BOARD=").append(Build.BOARD).append('\n');
result.append("BRAND=").append(Build.BRAND).append('\n');
result.append("CPU_ABI=").append(Build.CPU_ABI).append('\n');
result.append("DEVICE=").append(Build.DEVICE).append('\n');
result.append("DISPLAY=").append(Build.DISPLAY).append('\n');
result.append("FINGERPRINT=").append(Build.FINGERPRINT).append('\n');
result.append("HOST=").append(Build.HOST).append('\n');
result.append("ID=").append(Build.ID).append('\n');
result.append("MANUFACTURER=").append(Build.MANUFACTURER).append('\n');
result.append("MODEL=").append(Build.MODEL).append('\n');
result.append("PRODUCT=").append(Build.PRODUCT).append('\n');
result.append("TAGS=").append(Build.TAGS).append('\n');
result.append("TIME=").append(Build.TIME).append('\n');
result.append("TYPE=").append(Build.TYPE).append('\n');
result.append("USER=").append(Build.USER).append('\n');
result.append("VERSION.CODENAME=").append(Build.VERSION.CODENAME).append('\n');
result.append("VERSION.INCREMENTAL=").append(Build.VERSION.INCREMENTAL).append('\n');
result.append("VERSION.RELEASE=").append(Build.VERSION.RELEASE).append('\n');
result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n');
if (flattenedParams != null) {
String[] params = SEMICOLON.split(flattenedParams);
Arrays.sort(params);
for (String param : params) {
result.append(param).append('\n');
}
}
return result.toString();
}
}
@@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Über 1D-Barcodes (Strichcodes)</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>Die altbekannten Strichcodes, wie solche auf Produktverpackungen, werden auch eindimensionale Barcodes genannt. Es gibt einige verbreitete Arten, wie den UPC (Universal Product Code) und den EAN (European Article Number). Die meisten schauen so aus:</p>
<p class="imgcenter"><img src="../images/big-1d.png"/></p>
<p>Diese Strichcodes enthalten eine einmalige Nummer, welche ein Produkt, wie ein Buch oder eine CD, beschreiben. Man kann nach dieser Nummer im Internet suchen, um Preise oder Beurteilungen zu finden.</p>
<p>Wenn man den Code eines Buches einscannt, kann man den Inhalt des Buches nach Wörtern oder Sätzen durchsuchen und alle Seiten finden, in denen dieses Wort vorkam:</p>
<p class="imgcenter"><img src="../images/search-book-contents.jpg"/></p>
</body>
</html>
@@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Über 2D-Barcodes</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>Der <strong>Barcode Scanner</strong> kann auch zweidimensionale Barcodes, wie den QR-Code und den DataMatrix-Code einlesen. Die Barcodes in diesem Beispiel enthalten einen Hyperlink auf die Projekt-Homepage von ZXing:</p>
<p class="imgcenter">
<img src="../images/big-qr.png"/>
<img src="../images/big-datamatrix.png"/>
<img src="../images/big-pdf417.png"/>
<img src="../images/big-aztec.png"/>
</p>
<p>Ein QR-Code kann auch eine Visitenkarte mit Kontaktinformationen wie Telefonnummern und E-Mail-Adressen enthalten. Wird ein solcher Code eingescannt, dann wird eine Auswahl an Aktionen angezeigt:</p>
<p class="imgcenter"><img src="../images/contact-results-screen.jpg"/></p>
<p>Neben URLs und Kontaktdaten können QR-Codes auch folgendes enthalten:</p>
<ul>
<li>Kalendereinträge, die man dem Kalender hinzufügen kann</li>
<li>Telefonnummern, die man anrufen oder abspeichern kann</li>
<li>SMS-Nachrichten, die man verschicken kann</li>
<li>E-Mail-Adressen, denen man eine Nachricht schreiben kann</li>
<li>Geographische Koordinaten, die zu der man die Karte öffnen kann</li>
<li>Einfachen Text, den man lesen oder in die Zwischenablage kopieren kann</li>
</ul>
</body>
</html>
@@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Barcode Scanner-Hilfe</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>Dies ist die offizielle Android App des Open-Source-Projekts ZXing:<br/>
<a href="http://github.com/zxing/zxing">http://github.com/zxing/zxing</a></p>
<p>Der <strong>Barcode Scanner</strong> verwendet die Kamera ihres Handys, um Barcodes zu lesen und Produktinformationen wie Preise und Bewertungen zu suchen.</p>
<p class="imgcenter"><img src="../images/scan-example.png"/></p>
<p>Er liest auch 2D-Barcodes wie den QR-Code und DataMatrix. Diese Barcodes können z.B. Links zu Webseiten enthalten oder Kontaktinformationen wie Telefonnummern und E-Mail-Adressen.</p>
<ul class="touchable">
<li><a href="whatsnew.html">Neues in dieser Version</a></li>
<li><a href="scanning.html">Tipps fürs scannen</a></li>
<li><a href="about1d.html">Mehr über 1D-Barcodes</a></li>
<li><a href="about2d.html">Mehr über 2D-Barcodes</a></li>
<li><a href="sharing.html">So erstellen Sie QR-Codes</a></li>
<li><a href="license.html">Datenschutz-, Rechts- und Lizenzinformationen</a></li>
</ul>
<p>Übersetzt von Google Translate.</p></body>
</html>
@@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Datenschutz-, Rechts- und Lizenzinformationen</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3>Datenschutz</h3>
<p><strong class="notranslate">Barcode Scanner</strong> sammelt, speichert oder übermittelt keine Informationen über seine Nutzer oder die Nutzung der Anwendung. Die Anwendung greift auf persönliche Daten wie Kontakte und Lesezeichen nur zu, um die Funktionalität der Anwendung zu implementieren, wie z.B. QR-Codes von Kontakten und Lesezeichen auf dem Bildschirm anzuzeigen.</p>
<p>Beachten Sie, dass diese Anwendung auf Dienste von Drittanbietern zugreift, dies sind Google Books, Google Produktsuche und Amazon. Dies geschieht, um weitere Informationen über ein Produkt nach einem Scan abzurufen und anzuzeigen. Diese Drittanbieter erhalten die eingescannten Daten und können diese auch loggen.
Auch kann es notwendig sein, die Anfrage an einen Server zu schicken, der von dieser Anwendung betrieben wird, um die Anfrage für einen Drittanbieter passend zu machen, wie z.B. die Unterzeichnung der Anfrage. Neben dem Suchbegriff wird keine weitere Informationen zu den Anfragen hinzugefügt.</p>
<p>Beachten Sie auch, dass diese Anwendung auf Web-Sites und Anwendungen von Drittanbietern verlinkt, wie z.B. Google Produktsuche. Es werden keine anderen Informationen übertragen, als die eingescannten Daten. Diese Seiten und Anwendungen sind unabhängig und nicht mit dieser Anwendung verbunden, daher werden sie nicht von dieser Datenschutzerklärung abgedeckt.</p>
<h3>Warenzeichen</h3>
<p><span class="notranslate">Google, Google Books, Google Product Search,
Barcode Scanner, ZXing, QR Code, Data Matrix, Aztec</span> sind Warenzeichen ihrer jeweiligen Eigentümer.</p>
<h3>Lizenz-und Urheberrecht</h3>
<p>Dieses Projekt basiert auf der <a class="notranslate" href="http://github.com/zxing/zxing">ZXing</a> Open-Source-Barcode-Scanning-Bibliothek und ist lizenziert unter den Bedingungen der <a class="notranslate" href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a>:</p>
<p style="font-size:200%"><a class="notranslate" href="../html/apache-license.txt">Apache License 2.0</a></p>
</body>
</html>
@@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Tipps fürs scannen</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>Der Scanner durchsucht kontinuierlich den rechteckigen Bereich auf dem Bildschirm. Dabei muss der Barcode vollständig im rechteckigen Sucher erscheinen:</p>
<p class="imgcenter"><img src="../images/demo-yes.png" style="padding:5px"/><img src="../images/demo-no.png" style="padding:5px"/></p>
<p>Für 1D-Barcodes, auch Strichcodes genannt, welche sich auf allen Handelsprodukten befinden, benötigt man ein Handy mit Autofokus. Ohne diesen können nur QR-Codes und DataMatrix-Codes eingescannt werden.</p>
<p>Wenn ein Barcode eingelesen wurde, piepst das Handy und es wird das Ergebnis des Scans angezeigt, sowie eine Beschreibung des Barcode-Inhalts, und verschiedene Möglichkeiten wie weiter verfahren werden soll.</p>
<p>Falls das Einscannen nicht richtig funktioniert, versuchen Sie das Handy ruhiger zu halten. Wenn das Bild unscharf ist, vergrößern oder verkleinern Sie den Abstand zum Barcode.</p>
<ul class="touchable">
<li><a href="about1d.html"> Über 1D-Barcodes </a></li>
<li><a href="about2d.html"> Über 2D-Barcodes </a></li>
</ul>
</body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>So erstellen Sie einen QR-Code</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>Der <strong>Barcode Scanner</strong> kann nicht nur QR-Codes einlesen, sondern auch selbst erzeugen und auf dem Bildschirm anzeigen. Diesen QR-Code können Sie dann einem Freund zeigen, der den Code mit seinen Handy einscannen kann.</p>
<p class="imgcenter"><img src="../images/scan-from-phone.png"/></p>
<p>Um diese Funktion zu nutzen, einfach auf dem Hauptbildschirm auf die Menü-Taste drücken, und auf <em>Senden</em> tippen. Dann wählen, ob Sie einen Kontakt, ein Lesezeichen, eine Anwendung oder den Inhalt der Zwischenablage senden wollen und der QR-Code wird automatisch generiert. Wenn Sie fertig sind, drücken Sie die Zurücktaste.</p>
<p>Um QR-Codes auf Ihrem Computer zu erzeugen, testen Sie den ZXing QR Code Generator, er basiert auf dem selben Quelltext wie dieses Programm: <a href="http://zxing.appspot.com/generator/">http://zxing.appspot.com/generator/</a></p>
</body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Neues in dieser Version von Barcode Scanner</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<ul>
<li> Die History-Funktion kann ausgeschaltet werden </li>
<li> Bug-Fixes </li>
</ul>
<p>Übersetzt von Google Translate.</p></body>
</html>
@@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>About 1D barcodes</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p>Traditional barcodes, such as those printed on product packaging, are also known as one dimensional barcodes. There are several types commonly used, including UPC and EAN. Most look similar to this:</p>
<p class="imgcenter"><img src="../images/big-1d.png"/></p>
<p>These 1D barcodes contain a unique code which typically describes a product, like a CD or a book. You can look this code up on the internet to find prices, reviews, and more.</p>
<p>If you scan a book, you can also search the contents of the book for a word or phrase, and find all the pages where it appears:</p>
<p class="imgcenter"><img src="../images/search-book-contents.jpg"/></p>
</body>
</html>
@@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>About 2D barcodes</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p><strong>Barcode Scanner</strong> also understands how to read two dimensional barcodes, like QR Codes and Data Matrix codes. For example, the codes below contain a hyperlink to the ZXing Project home page:</p>
<p class="imgcenter">
<img src="../images/big-qr.png"/>
<img src="../images/big-datamatrix.png"/>
<img src="../images/big-pdf417.png"/>
<img src="../images/big-aztec.png"/>
</p>
<p>You can also represent contact information in a QR Code, and put it on a business card or web site. When you scan it, the results screen provides a choice of actions:</p>
<p class="imgcenter"><img src="../images/contact-results-screen.jpg"/></p>
<p>Besides URLs and contact info, QR Codes can also contain:</p>
<ul>
<li>Calendar events, which you can add to your Calendar</li>
<li>Phone numbers, which you can dial</li>
<li>SMS numbers, which you can text message</li>
<li>Email addresses, which you can email</li>
<li>Geographic coordinates, which you can open in Maps</li>
<li>Plain text, which you can read, then share with a friend</li>
</ul>
</body>
</html>
@@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Barcode Scanner Help</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p>The official Android app of the open source ZXing project:<br/>
<a href="http://github.com/zxing/zxing">http://github.com/zxing/zxing</a></p>
<p>Barcode Scanner uses the camera on your phone to read barcodes and look up product information such as prices and reviews.</p>
<p class="imgcenter"><img src="../images/scan-example.png"/></p>
<p>It also reads 2D barcodes such as QR Codes and Data Matrix. These can contain links to web sites, contact information such as phone numbers and email addresses, and more.</p>
<ul class="touchable">
<li><a href="whatsnew.html">What's new in this version</a></li>
<li><a href="scanning.html">How to scan</a></li>
<li><a href="about1d.html">About 1D barcodes</a></li>
<li><a href="about2d.html">About 2D barcodes</a></li>
<li><a href="sharing.html">How to create QR Codes</a></li>
<li><a href="license.html">Privacy Policy, Legal and License Information</a></li>
</ul>
</body>
</html>
@@ -1,42 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>Privacy Policy, Legal and License Information</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<h3>Privacy Policy</h3>
<p><strong class="notranslate">Barcode Scanner</strong> does not collect, store or transmit information about its
users, nor usage of the application. The application accesses personal information such as contacts
and bookmarks only in order to implement application functionality, such as sharing contacts and bookmarks
by QR Codes on screen.</p>
<p>Note that this application accesses third-party services, including Google Books, Google Product Search and Amazon,
in order to retrieve additional information following a scan. These third parties receive and may log these requests.
Also, it may be necessary to send the request to a server operated by this application, in order to transform the
request for use with the third-party service, such as signing the request.
No additional information is added to the requests besides the query terms.</p>
<p>Also note that this application links to third-party web sites and applications. Again,
no information other than query terms are passed on as part of these links. These sites and applications are
separate from and not affiliated with this application, and are not covered by this Privacy Policy.</p>
<h3>Trademarks</h3>
<p><span class="notranslate">Google, Google Books, Google Product Search,
Barcode Scanner, ZXing, QR Code, Data Matrix, Aztec</span>
are all trademarks of their respective owners.</p>
<h3>License and Copyright</h3>
<p>This project is based on the <a href="http://github.com/zxing/zxing" class="notranslate">ZXing</a> open source barcode
scanning library, and is licensed to you under the terms of the
<a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="notranslate">Apache License 2.0</a>:</p>
<p style="font-size:200%"><a href="../html/apache-license.txt" class="notranslate">Apache License 2.0</a></p>
</body>
</html>
@@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>How to scan</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p>Barcode Scanner continuously scans a square region shown on your screen -- just line up the phone so the barcode is completely inside the viewfinder rectangle:</p>
<p class="imgcenter"><img src="../images/demo-yes.png" style="padding:5px"/><img src="../images/demo-no.png" style="padding:5px"/></p>
<p>1D barcodes like those found on products require a phone with autofocus. Without it, only 2D formats like QR Codes and Data Matrix codes will be scannable.</p>
<p>When a barcode is read, a beep sound will play and you'll see the results of the scan, a description of what the barcode contains, and options to take action on the contents.</p>
<p>If you're having trouble scanning, make sure to hold the phone steady. If the camera is unable to focus, try moving the phone further or closer from the barcode.</p>
<ul class="touchable">
<li><a href="about1d.html">About 1D barcodes</a></li>
<li><a href="about2d.html">About 2D barcodes</a></li>
</ul>
</body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>How to create QR Codes</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p>In addition to scanning 2D barcodes, Barcode Scanner can also generate a QR Code and display it on your screen. Then you can show it to a friend, and let them scan the barcode with their phone:</p>
<p class="imgcenter"><img src="../images/scan-from-phone.png"/></p>
<p>To use this feature, press the Menu button from the main scanning screen, and tap Share. Then choose whether you want to share a contact, a bookmark, an application, or the contents of the clipboard. A QR Code will be generated automatically. When you're done, press Back or Home.</p>
<p>To generate QR Codes from your computer, try the ZXing QR Code Generator: <a href="http://zxing.appspot.com/generator/">http://zxing.appspot.com/generator/</a></p>
</body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title>What's new in Barcode Scanner</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<ul>
<li>The History feature can be turned off</li>
<li>Bug fixes</li>
</ul>
</body>
</html>
@@ -1,18 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Acerca de los códigos de barras 1D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Códigos de barras tradicionales, tales como las impresas en el embalaje del producto,
se conocen también como uno códigos de barras bidimensionales. Existen varios tipos de uso común,
incluyendo UPC y EAN. La mayoría de aspecto similar a este: </p>
<p class="imgcenter"><img src="../images/big-1d.png"/></p>
<p> Estos códigos de barras 1D contiene un código único que generalmente describe un producto, como un CD o un libro.
Usted puede ver este código en el Internet para encontrar precios, comentarios y más. </p>
<p> Si digitaliza un libro, también puede buscar en el contenido del libro para una palabra o frase, y encontrar todas
las páginas en las que aparece: </p>
<p class="imgcenter"><img src="../images/search-book-contents.jpg"/></p>
</html>
@@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Acerca de los códigos de barras 2D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p><strong> Barcode Scanner </strong> También entiende cómo leer dos códigos de barras bidimensionales,
como los códigos QR y códigos Data Matrix. Por ejemplo, los códigos que siguen contienen un hipervínculo a la
página principal de Project ZXing: </p>
<p class="imgcenter">
<img src="../images/big-qr.png"/>
<img src="../images/big-datamatrix.png"/>
<img src="../images/big-pdf417.png"/>
<img src="../images/big-aztec.png"/>
</p>
<p> También puede representar la información de contacto en un código QR, y usarlo en una tarjeta
de visita o en un sitio web. Cuando se escanea, la pantalla de resultados se ofrecen una serie de acciones: </p>
<p class="imgcenter"><img src="../images/contact-results-screen.jpg"/></p>
<p> Además de las direcciones URL y la información de contacto, los códigos QR también puede contener: </p>
<ul>
<li> Los eventos del calendario, que se pueden añadir a su calendario </li>
<li> Los números de teléfono, que puede marcar </li>
<li> SMS números, a los que puede enviar mensaje de texto </li>
<li> Direcciones de correo electrónico, a los que se puede enviar por correo electrónico </li>
<li> Coordenadas Geográficas, que se puede abrir en Mapas </li>
<li> Texto sin formato, que se puede leer, compartir con un amigo </li>
</ul>
</html>
@@ -1,24 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Ayuda de Barcode Scanner</title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> La aplicación oficial de Android del proyecto de código abierto ZXing:<br/>
<a href="http://github.com/zxing/zxing"> http://github.com/zxing/zxing </a></p>
<p> Barcode Scanner utiliza la cámara de su móvil para leer códigos de barras y buscar información sobre
los productos como los precios y las revisiones. </p>
<p class="imgcenter"><img src="../images/scan-example.png"/></p>
<p> También lee los códigos de barras 2D, como los Códigos QR y Data Matrix. Estos pueden contener enlaces
a otros sitios web, información de contacto, como números de teléfono y direcciones de correo electrónico y mucho más. </p>
<ul class="touchable">
<li><a href="whatsnew.html"> ¿Qué hay de nuevo en esta versión? </a></li>
<li><a href="scanning.html"> Cómo escanear </a></li>
<li><a href="about1d.html"> Acerca de los códigos de barras 1D </a></li>
<li><a href="about2d.html"> Acerca de los códigos de barras 2D </a></li>
<li><a href="sharing.html"> Cómo crear códigos QR </a></li>
<li><a href="license.html"> Política de Privacidad Información Legal y Licencia </a></li>
</ul>
</html>
@@ -1,39 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Política de Privacidad Información Legal y Licencia </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3> Política de privacidad </h3>
<p><strong class="notranslate">Barcode Scanner</strong> no recogerá, almacenará ni transmitirá información sobre sus usuarios,
ni de uso de la aplicación. La aplicación tiene acceso a información personal, como contactos y favoritos solo con el fin
de implementar la funcionalidad de la aplicación, tales como el intercambio de contactos y favoritos de los códigos QR en
la pantalla. </p>
<p> Tenga en cuenta que esta aplicación tiene acceso a servicios de terceros, como Google Books, Google Product Search
y Amazon, con el fin de obtener información adicional después de una exploración. Estos terceros pueden recibir y
registrar estas solicitudes. Además, puede ser necesario el envío de la solicitud a un servidor operado por esta
aplicación, con el fin de transformar la solicitud para su uso con el servicio de terceros, tales como la firma de
la solicitud. No hay información adicional añadida a las peticiones, además de los términos de la consulta. </p>
<p> También tenga en cuenta que los enlaces de esta solicitud a sitios web de terceros y aplicaciones. Una vez más,
hay más información que los términos de consulta se transmiten como parte de estos enlaces. Estos sitios y aplicaciones
son independientes y no afiliados a esta solicitud, y no están cubiertos por esta Política de Privacidad. </p>
<h3> Marcas comerciales </h3>
<p><span class="notranslate">Google, Google Books, Google Product Search,
Barcode Scanner, ZXing, QR Code, Data Matrix, Aztec</span> son marcas comerciales de sus respectivos propietarios. </p>
<h3> Licencia y Derechos de Autor </h3>
<p> Este proyecto se basa en la <a class="notranslate" href="http://github.com/zxing/zxing">ZXing</a> código de barras
de código abierto biblioteca de exploración, y está disponible para usted bajo los términos de la
<a class="notranslate" href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a> : </p>
<p style="font-size:200%"><a class="notranslate" href="../html/apache-license.txt">Apache License 2.0</a></p>
</html>
@@ -1,18 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Cómo escanear </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Barcode Scanner escanea continuamente una región cuadrada que aparece en su pantalla - Sólo basta introducir el código de barras es completamente dentro del rectángulo del visor: </p>
<p class="imgcenter"><img src="../images/demo-yes.png" style="padding:5px"/><img src="../images/demo-no.png" style="padding:5px"/></p>
<p> Códigos de barras 1D, como las que se encuentran en los productos requieren un teléfono con enfoque automático. Sin él, sólo los códigos QR y códigos Data Matrix serán susceptibles de ser analizados. </p>
<p> Cuando un código de barras es leído, un sonido será reproducido y podrás ver los resultados del análisis, una descripción de lo que contiene el código de barras, y las distintas opciones ejecutar acciones. </p>
<p> Si usted está teniendo problemas de escaneo, asegúrese de sujetar el teléfono estable. Si la cámara no puede enfocar, mueva el teléfono más lejos o más cerca del código de barras. </p>
<ul class="touchable">
<li><a href="about1d.html"> Acerca de los códigos de barras 1D </a></li>
<li><a href="about2d.html"> Acerca de los códigos de barras 2D </a></li>
</ul>
</html>
@@ -1,13 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Cómo crear códigos QR </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Además de escanear códigos de barras 2D, Barcode Scanner también puede generar un código QR y lo mostrará en la pantalla. A continuación, lo puede mostrar a un amigo, y dejar que escanear el código de barras con su teléfono: </p>
<p class="imgcenter"><img src="../images/scan-from-phone.png"/></p>
<p> Para utilizar esta función, presione el botón Menú en la pantalla de exploración principal y presione Compartir. A continuación, seleccione si desea compartir un contacto, un marcador, una aplicación o el contenido del portapapeles. Un código QR se generará automáticamente. Cuando haya terminado, pulse Atrás o Inicio. </p>
<p> Para generar códigos QR desde su computadora, pruebe el generador ZXing Código QR: <a href="http://zxing.appspot.com/generator/"> http://zxing.appspot.com/generator/ </a></p>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> ¿Qué hay de nuevo en Barcode Scanner? </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<ul>
<li> La función de Historia se puede apagar </li>
<li> Corrección de errores </li>
</ul>
<p>Traducido por Google Translate.</p></body>
</html>
@@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> À propos de codes à barres 1D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Codes à barres traditionnels, tels que ceux imprimés sur l'emballage du produit, sont également connus comme une dimension codes à barres. Il existe plusieurs types couramment utilisés, y compris l'UPC et EAN. La plupart ressembler à ceci: </p>
<p class="imgcenter"><img src="../images/big-1d.png"/></p>
<p> Ces codes à barres 1D contient un code unique qui décrit typiquement un produit, comme un CD ou un livre. Vous pouvez regarder ce code sur internet pour trouver les prix, critiques et autres. </p>
<p> Si vous numérisez un livre, vous pouvez également rechercher le contenu du livre pour un mot ou une phrase, et de trouver toutes les pages où il apparaît: </p>
<p class="imgcenter"><img src="../images/search-book-contents.jpg"/></p>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,27 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> À propos de codes-barres 2D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p><strong> Barcode Scanner </strong> comprend également comment lire deux dimensions, comme les codes-barres QR Codes et les codes Data Matrix. Par exemple, les codes ci-dessous contiennent un lien hypertexte vers la page d'accueil du projet ZXing: </p>
<p class="imgcenter">
<img src="../images/big-qr.png"/>
<img src="../images/big-datamatrix.png"/>
<img src="../images/big-pdf417.png"/>
<img src="../images/big-aztec.png"/></p>
<p> Vous pouvez également représenter des informations de contact dans un QR Code, et le mettre sur une carte de visite ou un site Web. Lorsque vous scannez, l'écran de résultats fournit un choix d'actions: </p>
<p class="imgcenter"><img src="../images/contact-results-screen.jpg"/></p>
<p> Outre les URL et les informations de contact, les codes QR peuvent aussi contenir: </p>
<ul>
<li> Calendrier des événements que vous pouvez ajouter à votre agenda </li>
<li> Les numéros de téléphone que vous pouvez composer </li>
<li> Numéros SMS, que vous pouvez Texte du message </li>
<li> Adresses e-mail, que vous pouvez envoyer un courriel </li>
<li> Coordonnées géographiques, que vous pouvez ouvrir dans Google Maps </li>
<li> Texte, que vous pouvez lire, puis partager avec un ami </li>
</ul>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Aide Barcode Scanner </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> L'application officielle Android du projet ZXing open source:<br/>
<a href="http://github.com/zxing/zxing"> http://github.com/zxing/zxing </a></p>
<p> Barcode Scanner utilise la caméra de votre téléphone pour lire des codes barres et de rechercher des informations sur des produits tels que les prix et les critiques. </p>
<p class="imgcenter"><img src="../images/scan-example.png"/></p>
<p> Il lit également les codes à barres 2D tels que les codes QR et Data Matrix. Ceux-ci peuvent contenir des liens vers des sites Web, communiquer avec des informations telles que les numéros de téléphone et adresses e-mail, et plus encore. </p>
<ul class="touchable">
<li><a href="whatsnew.html"> Quoi de neuf dans cette version </a></li>
<li><a href="scanning.html"> Comment numériser </a></li>
<li><a href="about1d.html"> À propos de codes à barres 1D </a></li>
<li><a href="about2d.html"> À propos de codes-barres 2D </a></li>
<li><a href="sharing.html"> Comment créer des codes QR </a></li>
<li><a href="license.html"> Politique de confidentialité, Informations légales et licence </a></li>
</ul>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Politique de confidentialité, Informations légales et licence </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3> Politique de confidentialité </h3>
<p><strong class="notranslate">Barcode Scanner</strong> ne pas collecter, stocker ou transmettre des informations sur ses utilisateurs, ni l'utilisation de l'application. L'application accède à des informations personnelles telles que les contacts et les signets seulement dans le but de mettre en œuvre des fonctionnalités de l'application, tels que le partage des contacts et des signets par les codes QR sur l'écran. </p>
<p> Notez que cette application accède à des services tiers, y compris Google Books, Google Recherche d'un produit et Amazon, afin de récupérer des informations supplémentaires à la suite d'une analyse. Ces tierces parties reçoivent et peuvent se connecter à ces demandes. En outre, il peut être nécessaire d'envoyer la requête à un serveur exploité par cette application, afin de transformer la demande pour une utilisation avec le service tiers, tels que la signature de la demande. Aucune information supplémentaire n'est ajouté aux demandes en dehors des termes de la requête. </p>
<p> A noter également que cette liens d'applications vers des sites et des applications Web de tiers. Encore une fois, aucune information autre que les termes de requête sont transmis dans le cadre de ces liens. Ces sites et applications sont séparés et ne pas affiliée à cette demande, et ne sont pas couverts par la présente Politique de confidentialité. </p>
<h3> Marques </h3>
<p><span class="notranslate">Google, Google Books, Google Product Search,
Barcode Scanner, ZXing, QR Code, Data Matrix, Aztec</span> sont tous des marques de commerce de leurs propriétaires respectifs. </p>
<h3> Licence et droits d'auteur </h3>
<p> Ce projet est basé sur la <a class="notranslate" href="http://github.com/zxing/zxing">ZXing</a> code à barres open source de numérisation bibliothèque, et est autorisé à vous en vertu de la <a class="notranslate" href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a> : </p>
<p style="font-size:200%"><a class="notranslate" href="../html/apache-license.txt">Apache License 2.0</a></p>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Comment numériser </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Barcode Scanner scanne en permanence une zone carrée affichée sur votre écran - ligne juste le téléphone de sorte que le code à barres est complètement à l'intérieur du rectangle du viseur: </p>
<p class="imgcenter"><img src="../images/demo-yes.png" style="padding:5px"/><img src="../images/demo-no.png" style="padding:5px"/></p>
<p> Codes à barres 1D comme ceux qu'on trouve sur les produits nécessitent un téléphone avec autofocus. Sans elle, seuls les codes QR et les codes Data Matrix sera analysable. </p>
<p> Quand un code-barres est lu, un bip sonore se jouer et vous verrez les résultats de l'analyse, une description de ce que le code à barres contient, et les options à prendre des mesures sur le contenu. </p>
<p> Si vous rencontrez des problèmes de numérisation, assurez-vous de tenir le téléphone fixe. Si l'appareil photo est incapable de se concentrer, essayez de déplacer le téléphone supplémentaire ou plus près du code à barres. </p>
<ul class="touchable">
<li><a href="about1d.html"> À propos de codes à barres 1D </a></li>
<li><a href="about2d.html"> À propos de codes-barres 2D </a></li>
</ul>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Comment créer des codes QR </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> En plus de la numérisation des codes à barres 2D, Barcode Scanner peut aussi générer un QR Code et l'afficher sur votre écran. Ensuite, vous pouvez le montrer à un ami, et laissez-les scanner le code-barres avec leur téléphone: </p>
<p class="imgcenter"><img src="../images/scan-from-phone.png"/></p>
<p> Pour utiliser cette fonction, appuyez sur la touche Menu depuis l'écran du balayage principal, puis appuyez sur Partager. Ensuite, choisissez si vous voulez partager un contact, un signet, une application ou le contenu du presse-papiers. Un Code QR est généré automatiquement. Lorsque vous avez terminé, appuyez sur Retour ou d'accueil. </p>
<p> Pour générer les codes QR à partir de votre ordinateur, essayez le générateur de code QR ZXing: <a href="http://zxing.appspot.com/generator/"> http://zxing.appspot.com/generator/ </a></p>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Quoi de neuf dans Barcode Scanner </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<ul>
<li> La fonction Historique peut être désactivée </li>
<li> Corrections de bugs </li>
</ul>
<p>Traduit par Google Translate.</p></body>
</html>
@@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> A proposito di codici a barre 1D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Codici a barre tradizionali, come quelle stampate sulla confezione del prodotto, sono noti anche come uno codici a barre bidimensionali. Ci sono diversi tipi di uso comune, tra cui UPC ed EAN. La maggior parte simile al seguente: </p>
<p class="imgcenter"><img src="../images/big-1d.png"/></p>
<p> Queste barre 1D contengono un codice unico che descrive tipicamente un prodotto, come un CD o un libro. È possibile cercare questo codice su internet per trovare i prezzi, recensioni e altro. </p>
<p> Se si esegue la scansione di un libro, è anche possibile cercare i contenuti del libro per una parola o una frase, e trovare tutte le pagine in cui appare: </p>
<p class="imgcenter"><img src="../images/search-book-contents.jpg"/></p>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> A proposito di codici a barre 2D </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p><strong> Barcode Scanner </strong> comprende anche come leggere due codici a barre bidimensionali, come i codici QR e codici Data Matrix. Per esempio, i seguenti codici contengono un collegamento ipertestuale alla pagina ZXing principale del progetto: </p>
<p class="imgcenter">
<img src="../images/big-qr.png"/>
<img src="../images/big-datamatrix.png"/>
<img src="../images/big-pdf417.png"/>
<img src="../images/big-aztec.png"/>
</p>
<p> È anche possibile rappresentare le informazioni di contatto in un QR Code, e metterlo su un biglietto da visita o un sito web. Quando si esegue la scansione, la schermata dei risultati fornisce una serie di azioni: </p>
<p class="imgcenter"><img src="../images/contact-results-screen.jpg"/></p>
<p> Oltre URL e informazioni di contatto, i codici QR possono contenere anche: </p>
<ul>
<li> Eventi del Calendario, che è possibile aggiungere al vostro calendario </li>
<li> I numeri di telefono, che possono essere digitati </li>
<li> Numeri di SMS, che è possibile il testo del messaggio </li>
<li> Indirizzi e-mail, che possono essere inviati per email </li>
<li> Coordinate geografiche, che è possibile aprire in Mappe </li>
<li> Testo semplice, che si può leggere, quindi condividere con un amico </li>
</ul>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Barcode Scanner Aiuto </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> L'applicazione ufficiale di Android del progetto aperto ZXing fonte:<br/>
<a href="http://github.com/zxing/zxing"> http://github.com/zxing/zxing </a></p>
<p> Scanner di codici a barre utilizza la fotocamera del telefono per leggere codici a barre e ricercare informazioni sui prodotti, i prezzi e le recensioni. </p>
<p class="imgcenter"><img src="../images/scan-example.png"/></p>
<p> Legge anche codici a barre 2D, come i codici QR e Data Matrix. Questi possono contenere link a siti web, informazioni di contatto, quali numeri di telefono e indirizzi e-mail e altro ancora. </p>
<ul class="touchable">
<li><a href="whatsnew.html"> Cosa c'è di nuovo in questa versione </a></li>
<li><a href="scanning.html"> Come eseguire la scansione </a></li>
<li><a href="about1d.html"> A proposito di codici a barre 1D </a></li>
<li><a href="about2d.html"> A proposito di codici a barre 2D </a></li>
<li><a href="sharing.html"> Come creare codici QR </a></li>
<li><a href="license.html"> Informazioni legali e di licenza </a></li>
</ul>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Privacy, Informazioni legali e di licenza </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3> Politica sulla privacy </h3>
<p><strong class="notranslate">Barcode Scanner</strong> non raccogliere, memorizzare o trasmettere le informazioni sui suoi utenti, né utilizzo dell'applicazione. L'applicazione accede a informazioni personali come contatti e segnalibri solo al fine di implementare la funzionalità dell'applicazione, come la condivisione di contatti e segnalibri da codici QR sullo schermo. </p>
<p> Si noti che questa applicazione accede a servizi di terze parti, tra cui Google Libri, Google Product Search e Amazon, al fine di recuperare le informazioni aggiuntive a seguito di una scansione. Queste terze parti ricevono e possono registrare queste richieste. Inoltre, può essere necessario inviare la richiesta a un server gestito da questa applicazione, per trasformare la richiesta per l'utilizzo con il servizio di terze parti, come la firma della richiesta. Nessuna informazione aggiuntiva si aggiunge alle richieste oltre i termini di query. </p>
<p> Si noti inoltre che i collegamenti questa applicazione per i siti Web di terze parti e le applicazioni. Anche in questo caso, nessuna informazione diversa termini di query vengono passati come parte di questi link. Questi siti e le applicazioni sono distinte e non è affiliato con questa applicazione, e non sono coperti da questa Informativa sulla privacy. </p>
<h3> Marchi di fabbrica </h3>
<p><span class="notranslate">Google, Google Books, Google Product Search,
Barcode Scanner, ZXing, QR Code, Data Matrix, Aztec</span> sono tutti marchi di fabbrica dei rispettivi proprietari. </p>
<h3> Licenza e Copyright </h3>
<p> Questo progetto si basa sulla <a class="notranslate" href="http://github.com/zxing/zxing">ZXing</a> barcode open source scansione biblioteca, e viene concesso in licenza sotto i termini della <a class="notranslate" href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a> : </p>
<p style="font-size:200%"><a class="notranslate" href="../html/apache-license.txt">Apache License 2.0</a></p>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Come eseguire la scansione </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Barcode Scanner analizza continuamente una regione quadrata mostrata sullo schermo - solo linea il telefono in modo che il codice a barre è completamente all'interno del rettangolo del mirino: </p>
<p class="imgcenter"><img src="../images/demo-yes.png" style="padding:5px"/><img src="../images/demo-no.png" style="padding:5px"/></p>
<p> Codici a barre 1D, come quelle che si trovano sui prodotti richiede un telefono con autofocus. Senza di essa, solo i codici QR e codici Data Matrix sarà leggibile. </p>
<p> Quando un codice a barre viene letto, un bip si giocare e vedrete i risultati della scansione, una descrizione di ciò che il codice a barre contiene, e le opzioni per intervenire sui contenuti. </p>
<p> Se hai dei problemi di scansione, assicurarsi di tenere il telefono fermo. Se la fotocamera non riesce a mettere a fuoco, provare a spostare il telefono lontano o più vicino dal codice a barre. </p>
<ul class="touchable">
<li><a href="about1d.html"> A proposito di codici a barre 1D </a></li>
<li><a href="about2d.html"> A proposito di codici a barre 2D </a></li>
</ul>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Come creare codici QR </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> Oltre alla scansione di codici a barre 2D, Barcode Scanner può anche generare un codice QR e visualizzarla sullo schermo. Poi si può mostrare ad un amico, e far loro eseguire la scansione del codice a barre con il proprio telefono: </p>
<p class="imgcenter"><img src="../images/scan-from-phone.png"/></p>
<p> Per utilizzare questa funzione, premere il tasto Menu dalla schermata di scansione principale, e toccare Condividi. Quindi scegliere se si desidera condividere un contatto, un segnalibro, un'applicazione, o il contenuto degli appunti. Un codice a barre verrà generato automaticamente. Al termine, premere Indietro o Home. </p>
<p> Per generare i codici QR dal tuo computer, provare il generatore di ZXing QR Code: <a href="http://zxing.appspot.com/generator/"> http://zxing.appspot.com/generator/ </a></p>
<p>Tradotto da Google Translate.</p></body>
</html>
@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<title> Cosa c'è di nuovo nella Barcode Scanner </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<ul>
<li> La funzione Cronologia può essere disattivata </li>
<li> Correzioni di bug </li>
</ul>
<p>Tradotto da Google Translate.</p></body>
</html>

Some files were not shown because too many files have changed in this diff Show More