Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Barcode scanning on Android

551 views

Published on

if you think that ZXing is all you need to do barcode scanning on Android and you're happy with it, this presentation is not for you.

Barcodes are a very old technology that is not going away anytime soon and if you need to scan a lot of barcodes, better to know what are the alternatives.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Barcode scanning on Android

  1. 1. EUROPE
  2. 2. Developer Session CREATE SCANNING APP Across Multiple Android Devices Pietro F. Maggi EMEA SW Consultant Sales Engineer
  3. 3. Part 1: Basics and Getting Started • Barcode Scanning on Zebra Devices • Disabling EMDK code when running on a non Zebra device Part 2: Guideline on going forward • Scanning across Multiple Android devices • Design Considerations Create Scanning Application Across Multiple Android Devices Outline
  4. 4. Part 1: Basics and Getting Started • Barcode Scanning on Zebra Devices • Disabling EMDK code when running on a non Zebra device Part 2: Guideline on going forward • Scanning across Multiple Android devices • Design Considerations Create Scanning Application Across Multiple Android Devices Outline
  5. 5. DataWedge Intent API: Intent based interface for DataWedge Pros: • Based on standard Android Intent API. • Features are exposed earlier in DW than Barcode API. Cons: • Full control requires DataWedge v6.3, only available on some Marshmallow devices. • Not possible to backport newer DataWedge version on older BSP. EMDK’s Barcode API: Java and Xamarin API Barcode scanning API Pros: • Full control of the Scanner Framework. Cons: • Complexity to handle Scanner lifecycle combined with Application lifecycle. • “EMDK Service has stopped” issues if this API is not implemented correctly. Barcode Scanning on Zebra Devices With Great Power Comes Great Responsibility
  6. 6. Design Considerations : Barcode Integration Do you really need a Barcode API? Complexity Control DataWedge Keyboard emulation legacy DataWedge Intents DataWedge 6.3 Intents* Barcode API *Not yet released
  7. 7. Clone Profile2 Create Profile3 Delete Profile2 Enable DataWedge2 Enumerate Scanners1 Get Active Profile2 Get DataWedge Status3 Get Profiles List2 Get Version Info3 Register/Unregister for Notification3 Rename Profile2 Reset Default Profile1 Restore Config3 Scanner Input Plug-in1 Set Config3 Set Default Profile1 Soft Scan Trigger1 Switch to Profile1 DataWedge Intent API Source: http://techdocs.zebra.com/datawedge/6-3/guide/api/ 1 Original DW API 2 New in DW v6.2 3 New in DW v6.3
  8. 8. Part 1: Basics and Getting Started • Barcode Scanning on Zebra Devices • Disabling EMDK code when running on a non Zebra device Part 2: Guideline on going forward • Scanning across Multiple Android devices • Design Considerations Create Scanning Application Across Multiple Android Devices Outline
  9. 9. Modify the Manifest to avoid “Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY” From: To: Install the Application How can you use the EMDK but still being able to install the app on a non Zebra device Source: http://techdocs.zebra.com/emdk-for-android/6-3/guide/programming_practices/
  10. 10. • Modify the main activity to avoid "ClassNotFoundException" exception Install the Application (cont.) How can you use the EMDK but still being able to install the app on a non Zebra device Source: http://techdocs.zebra.com/emdk-for-android/6-3/guide/programming_practices/
  11. 11. Look for the package: Directly checking for EMDK Checking for EMDK package allows to get info about installed version Source: http://techdocs.zebra.com/emdk-for-android/6-3/guide/programming_practices/
  12. 12. Use the package manager to get the information you need: Directly checking for EMDK (Cont.) Checking for EMDK package allows to get info about installed version Source: https://github.com/pfmaggi/GetDeviceInfo_EMDK
  13. 13. Part 1: Basics and Getting Started • Barcode Scanning on Zebra Devices • Disabling EMDK code when running on a non Zebra device Part 2: Guideline on going forward • Scanning across Multiple Android devices • Design Considerations Create Scanning Application Across Multiple Android Devices Outline
  14. 14. Zxing: “Zebra Crossing” OpenSource Barcode Scanning Solutions …one true king Source: https://github.com/zxing/zxing/
  15. 15. • Zebra Technology Software Decode for Cameras • Scandit library Commercial Barcode Scanning Solutions Some very good (and sometime expensive) options Source: https://www.zebra.com/us/en/products/oem/oem-engines/oem-software-decode/software-decode-for-cameras.html https://www.scandit.com
  16. 16. Reimplement DataWedge Intent API on other platforms: • Pros: • Barcode Scanning became someone else problem • Once a *Wedge is implemented for a platform/library, it can support multiple application • Cons: • Requires a second application to be installed on the device to have Barcode Scanning working Scanning across Multiple Android devices DataWedge Intent API –Yes a *Wedge Source: https://darryncampbellblog.wordpress.com/2016/08/16/writing-enterprise-android-applications-that-capture-barcode-data-and- run-on-multiple-devices/
  17. 17. Scanning across Multiple Android devices DataWedge Intent API –Yes a *Wedge
  18. 18. Generic Interface: • IScanner • Handle Configuration • Enable / Disable Scanner • Start / Stop Barcode decoding • IScannerListener • Scan succeeds callback with data • Scan failure callback with error condition (timeout, missing permission, etc.) Multiple implementation with Enterprise SDK or Consumer Barcode decoding libraries Scanning across Multiple Android devices Barcode API implementation of a generic interface
  19. 19. Scanning across Multiple Android devices Implementation of a generic interface User Application Activities Scanner implementation with Zebra Barcode API Zebra Scanner Zebra Device Scanner implementation with Other OEM API Other OEM Scanner Enterprise Device, non-Zebra Scanner implementation with Zxing or Google BarcodeAPI IScanner Interfaces Device Camera Consumer Device IScannerListener Interfaces
  20. 20. Part 1: Basics and Getting Started • Barcode Scanning on Zebra Devices • Disabling EMDK code when running on a non Zebra device Part 2: Guideline on going forward • Scanning across Multiple Android devices • Design Considerations Create Scanning Application Across Multiple Android Devices Outline
  21. 21. Barcode API Async all the way…
  22. 22. • The scanner.enable() is an async call and app must wait for the IDLE status before setting the configuration • The scanner.cancelRead() is an async call and app must wait for the IDLE status and check for isReadPending() before setting the configuration or issuing the next read. • The EMDKListener.onClosed() is called notify the application when the EMDK service is stopped unexpectedly either due to low memory or any other crash at the EMDK or Scanner Framework work. Barcode API Know before you start
  23. 23. Building multiple applications to install on a single device? • Implement what you need in a ScanWedge Design Considerations Closing thoughts Building a single application to install on an Android device? • A Scanning interface with the implementation for your devices
  24. 24. • https://developer.zebra.com/community/android: Zebra developer Portal • http://techdocs.zebra.com: Zebra Technical Documentation Portal • http://techdocs.zebra.com/emdk-for-android/6- 3/guide/programming_practices/#creatingacommonapplicationtorunonzebraandnonz ebradevices: EMDK for Android Guide • https://github.com/darryncampbell/GenericScanWedge: ZXing based ScanWedge implementation by @darryncampbell Scanning Across Multiple Android Devices Some key References
  25. 25. QUESTIONS?
  26. 26. Please take a moment to rate this session using the APPFORUM mobile app. THANK YOU

×