Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for Android

Scandit SDK Concepts

Memory Management Rules

Object represented by opaque pointers in Scandit SDK internally use reference counting. To claim ownership of an object, the reference count of the object is increased and decreased again when the object is no longer needed. When the reference count drops to zero, e.g. the object has no owners, the object is deallocated (freed).

To claim ownership of an object, use one of the sc_*_retain functions and sc_*_release when you finished using it.

Some objects returned by functions are automatically owned by the caller and must be released after use, whereas others must be retained manually, if required. The following rules apply:

  • Objects created by you (using any of the *_new functions) must be released after use by you.
  • Objects returned by functions that explicitly state they transfer ownership to you, must be released after use. An examples of such a function is sc_barcode_scanner_session_get_newly_recognized_codes().
  • You must release objects on which you called sc_*_retain

Differences to the Picker API

If you have previously developed an application using the Scandit SDK Picker API on Android or iOS and are now using the Scandit SDK low-level API for scanning barcodes, there are a few differences to be aware of:

  • The symbology names returned by sc_symbology_to_string() are not the same as the symbology names used by the picker APIs.
  • When using the picker, the leading zero digit is removed from scanned UPCA codes. The low-level API includes the leading zero. If you wish to remove the leading zero, you can do so by enabling the "remove_leading_zero" extension for the UPCA symbology.

Image Coordinate System

All (relative) coordinates used in the barcode scanner SDK are defined in image coordines of the frame in memory. The origin, coordinate (0,0), is in the upper left corner. The x-direction (width) points to the right and the y-direction (height) points downwards.

Be aware that the camera sensors of most devices capture images in landscape mode and the display on screen depends on the device orientation and does not necessarily correspond to the layout of the camera image in memory. Different screen coordinate systems and use-cases require mirroring and/or rotation to obtain the correct location areas or code directions in image space. The inverse transform has to be applied if the location of a recognized code should be displayed in screen space.