Developer

OpenScan Overview for iOS

The SMPOpenScan framework allows application developers to integrate their preferred third-party scanning library into a SAP Mobile Platform Agentry application.

Examples of scanners include a camera-based barcode scanning SDK such as ZBar, or a hardware scanner such as the Socket Mobile CHS7 scanner. The SAP Mobile Platform Agentry Client still supports default camera-based scanning functionality.

Application developers must create an interface class, which implements the SMPOpenScanChannel protocol, as well as the protocols needed by the external scanning library. The SMPOpenScanChannel protocol methods are needed to initiate scanning activity, and to send scanned data to Agentry.

Getting Started

To get started, you must integrate a third-party scanning library into an Agentry iOS client application. Several example interface classes are available, and you can use these examples to see how to integrate libraries into the demo project:

The SMPAgentryClientFrameworkDemo Xcode project was originally created to demonstrate SMPOpenUI usage, but it also demonstrates how to support SMPOpenScan in Agentry. This Xcode project is preconfigured for 64-bit compilation, but the ZBar sample SDK is a 32-bit release. Compiling the Xcode project for 64-bit compilation for a 64-bit device target requires the third-party scanning library to be built as, and to support, a 64-bit compilation. Therefore, when targeting a 64-bit device for the ZBar example, you must either modify the Xcode project to build for a 32-bit compilation, or recompile the ZBar SDK to a 64-bit compilation. The Socket Mobile ScanAPI SDK supports both 32-bit and 64-bit compilations, so its integration does not require any updates to the Xcode project.

Example: ZBar SDK Integration

Integrate the ZBar SDK scan into an Xcode project.

Prerequisites
Integration Steps
  1. In Xcode, open SMP_SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/Samples/SMPAgentryClientFrameworkDemo/SMPAgentryClientFrameworkDemo.xcodeproj.

  2. Follow integration steps in ZBarSDK Getting Started (section 1.1.3): http://zbar.sourceforge.net/iphone/sdkdoc/install.htmlInformation published on non-SAP site to add ZBarSDK to the demo project. ZBarSDK-1.2.dmg only provides a 32-bit ZBar SDK library (libzbar.a). When targeting a 64-bit device, you must either modify the Xcode project to a 32-bit build configuration, or recompile the ZBar SDK as a 64-bit library. The following steps generate a 64-bit ZBar SDK library:
    1. Check out source code from https://github.com/ZBar/ZBarInformation published on non-SAP site.

    2. Navigate to the iphone folder, and open the zbar.xcodeproj.

    3. Go to Build Settings of the libzbar target, and set "Valid Architectures" to arm64, armv7, armv7s, i386, and x86_64.

    4. Build the target with both iOS SDK and iOS Simulator SDK, and create the fat library file.

  3. Locate SMPZBarScanChannel.mm and SMPZBarScanChannel.h in SMP_SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/Samples/SMPAgentryClientFrameworkDemo/SMPAgentryClientFrameworkDemo, and add them to the project.

  4. Follow the instructions in ZBar SDK Integration Tutorial (http://zbar.sourceforge.net/iphone/sdkdoc/tutorial.htmlInformation published on non-SAP site) to update SMPZBarScanChannel.mm to create and configure zbarReader, and to obtain decoded data.

  5. In Xcode project navigator, select Info.plist under SMPAgentryClientResources.bundle.
  6. Connect the iOS device with the Mac, and build the demo application on the iOS device.

Example: Socket Mobile CHS7 ScanAPI SDK Integration

Integrate the Socket Mobile CHS7 ScanAPI SDK into an Xcode project.

Prerequisites
  • A Mac with Xcode 6.0.1 or later, installed and ready to develop for iOS.

  • Expand the SMPAgentryClientFramework distribution into a directory named SMP_SDK_INSTALL_HOME.

  • Download the Socket Mobile ScanAPI SDK from: http://www.socketmobile.com/developer/Information published on non-SAP site.

  • A Socket Mobile CHS7 Scanner.

  • An iOS6 or iOS7 device.

Integration Steps
  1. In Xcode, open SMP_SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/Samples/SMPAgentryClientFrameworkDemo/SMPAgentryClientFrameworkDemo.xcodeproj.

  2. Follow the steps from the ScanAPI SDK Readme file (see Introduction, in Section 1) to pair a CHS7 scanner with an iOS device.

  3. Follow the steps from the ScanAPI SDK Readme file (see ScanAPI Usage, in Section 3) to integrate ScanAPI into the SMPAgentryClientFrameworkDemo Xcode project, taking note that changes involving source code updates are already incorporated into the SMPAgentryClientFrameworkDemo's sample code.

  4. In Xcode project navigator, select Info.plist under SMPAgentryClientResources.bundle.
  5. Add SMPSocketMobileScanChannel.mm and SMPSocketMobileScanChannel.h in SMP_SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/Samples/SMPAgentryClientFrameworkDemo/SMPAgentryClientFrameworkDemo to the project

  6. Connect the iOS device with Mac and build the demo application on the iOS device.