PIOS Scanner API Guidelines
This document explains several guidelines for the Peripheral Input/Output Services (PIOS) Scanner API, part of the SAP NetWeaver Mobile client API. Each of the guidelines is discussed below.
These guidelines are intended for all the developers working on the SAP NetWeaver Developer Studio in a mobile application with scanner peripheral requirements. It helps the developer get the most out of the PIOSinfrastructure. The developer can access these features provided by PIOS through the SAP NetWeaver Mobile client API.
Establishing a Connection to the Scanner
Since multiple applications can be running in a mobile device at a given time, it is recommended that mobile applications should open the connection to the scanner when they are ready to scan data and close the connection when they have finished receiving the data. This prevents other applications from having to wait for the first one to close before they can open a connection. Otherwise if a mobile application opens the scanner connection when it starts and does not close it until it finishes, no other application may use the scanner until the first one finishes. Any other mobile application that tries to open a connection to the scanner will receive an error message.
Start Read and End Read
Use Start Read method only when you need to scan a barcode, and use End Read as soon as the scanning is done. The Start Read method starts the scanner engine thus consuming more processor time and battery power, as opposed to when the engine is stopped.
When to use the Scanner Connection, Start Read, and End Read
If an application has several windows (that require scanner support), it is recommended to establish one connection (one open and one close) to the scanner per window. After the connection has been opened, the application may call as many Start/End Reads as necessary.

Any modification (set or remove options) to the Scanner Connection must be made before the start read. If the application tries to set an option after the start read, an error will be generated.
Scan Aware Mode and Wedge Mode
It is recommended to use scan aware mode whenever is possible. This mode is more flexible than its counterpart because it allows data manipulation and does not restrict the incoming data to the screen with the focus on it. If a developer is creating an application from scratch, it is recommended that he/she uses the scan aware mode.
Wedge mode should be limited to a situation where an application has already been developed and scanning functionality must be added to the application. Wedge mode requires the least amount of changes to the existing application because it returns data as if it was entered from the keyboard.
Symbology Types
Use as few symbology types as possible. Limit the active symbology types to the ones that are going to be used by the application. The more active symbology types the scanner has, the longer it takes to initialize.
Soft Trigger
The Scanner API provides the ability to activate the laser beam from the application. This feature is particularly important when the only way to activate the laser beam is from the application because there is no physical trigger button. This can be the case with a scanner that attaches to device, for instance.
Preamble and Postamble
These two methods allow you to add data before and after the scanned data respectively. This could prove useful when using a tab, or something similar, as postamble.

An application could scan several barcodes and send the scanned data to a spreadsheet. If a tab is set as the postamble, the data is sent to a cell and the focus skips to the next cell, ready to receive the next barcode.