4 - 50 TC70x/TC75x Integrator Guide
Example
Comments
The API command will have no effect if the specified Profile does not exist or if the specified Profile is already
associated with an application. DataWedge will automatically switch Profiles when the activity is paused, so it is
recommended that this API function be called from the onResume method of the activity.
Zebra recommends that this Profile be created to cater to all applications/activities that would otherwise default to
using Profile0. This will ensure that these applications/activities continue to work with a consistent configuration.
For example, let’s say that initially Profile0 is the default Profile using the camera as the barcode scanner. Using
the Browser application and scanning a barcode with the camera, DataWedge enters the data into the Browser.
Now launch an application that changes the default Profile to a Profile using the blockbuster as the barcode
scanner. When returning to the Browser application, since it is using the default Profile, scanning will now be via
the blockbuster not the camera as previously. To ensure that the Browser continues to use the camera as the
barcode scanner a Profile should be created and associated with the Browser that specifies the camera as the
barcode scanner.
// define action and data strings
String setDefaultProfile = "com.symbol.datawedge.api.ACTION_SETDEFAULTPROFILE";
String extraData = "com.symbol.datawedge.api.EXTRA_PROFILENAME";
public void onResume() {
// create the intent
Intent i = new Intent();
// set the action to perform
i.setAction(setDefaultProfile);
// add additional info
i.putExtra(extraData, "myProfile");
// send the intent to DataWedge
context.this.sendBroadcast(i);
}