Datawedge Configuration
149
Notes
Because DataWedge will automatically switch Profile when the activity is paused, Zebra recommends that this API
function be called from the onResume method of the activity.
After switching to a Profile, this unassociated Profile does not get assigned to the application/activity and is
available to be used in the future with a different app/activity.
For backward compatibility, DataWedge’s automatic Profile switching is not affected by the above API commands.
This why the commands work only with unassociated Profiles and apps.
DataWedge auto Profile switching works as follows:
Every second…
• Sets newProfileId to the associated Profile ID of the current foreground activity.
• If no associated Profile is found, sets newProfileId to the associated Profile ID of the current foreground
app.
• If no associated Profile is found, sets newProfileId to the current default Profile (which MAY NOT be
Profile0).
• Checks the newProfileId against the currentProfileId. If they are different:
• deactivates current Profile
• activates new Profile (newProfileId)
• sets currentProfileId = newProfileId
Imager as Camera
Use the standard Android SDK Camera API functions to operate the imager scanner as a camera. When using the
imager scanner as a camera, the following Camera API functions are supported:
• Camera.open(ID) - Set ID to 100 to open the Imager Scanner as a camera instance.
• Camera.release() - Release the Imager Scanner opened using camera API.
• Camera.setPreviewDisplay(surfaceHolder) - Add SurfaceView via SurfaceHolder to show preview.
• Camera.SetPreviewCallback(PreviewCallback) - Set previewCallback to get preview data.
• Camera.startPreview() - Starting Imager Scanner preview via SurfaceView.
• Camera.stopPreview() - Stopping Imager Scanner preview showing in SurfaceView.
• Camera.getCameraInfo(CameraID,CameraInfo) – Get camera information on camera ID. CameraInfo
has the following members:
• orientation
• facing
• canDisableShutterSound
Use the Zebra Mx architecture to decode barcodes with the imager scanner when the imager as camera feature is
disabled. When the imager as camera feature is enabled the imager can not decode barcodes and capture images
at the same time.
NOTE: Use of this API changes only the runtime status of the scanner; it does not make persistent changes to
the Profile.