DataWedge
99
Switch To Profile
Use the SwitchToProfile API action to switch to the specified Profile.
Profiles Recap
DataWedge is based on Profiles and plug-ins. A Profile contains information on how DataWedge should
behave with different applications.
Profile information consists of:
• Associated application
• Input plug-in configurations
• Output plug-in configurations
• Process plug-in configurations
DataWedge includes a default Profile, Profile0, that is created automatically the first time DataWedge runs.
Using Profiles, each application can have a specific DataWedge configuration. For example, each user
application can have a Profile which outputs scanned data in the required format when that application comes
to the foreground. DataWedge can be configured to process the same set of captured data differently based on
the requirements of each application.
NOTE: Use of this API changes only the runtime status of the scanner; it does not make persistent changes to the Profile.
A single Profile may be associated with one or many activities/apps, however, given an activity, only one Profile may be
associated with it.
Usage Scenario
An application has two activities. Activity A only requires EAN13 bar codes to be scanned. Activity B only
requires Code 128 bar codes to be scanned. Profile EAN13 is configured to only scan EAN13 bar codes and is
left unassociated. Profile Code128 is configured to scan Code 128 and is left unassociated. When Activity A
launches it uses SwitchToProfile to activate Profile EAN13. Similarly, when Activity B launches it uses
switchToProfile to activate Profile Code128.
If another activity/app comes to the foreground, DataWedge auto Profile switching sets the DataWedge Profile
accordingly either to the default Profile or to an associated Profile.
When Activity A (or Activity B) comes back to the foreground it uses switchToProfile to reset the Profile back to
Profile B (or Profile M).
Function Prototype
Parameters
ACTION [String]: "com.symbol.datawedge.api.ACTION"
EXTRA_DATA [String]: "com.symbol.datawedge.api.SWITCH_TO_PROFILE"
Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.putExtra("com.symbol.datawedge.api.SWITCH_TO_PROFILE", "<profile name>");