Profile Switcher is a utility application that has been developed to facilitate efficient switching between the default profile (Profile0) and a custom profile in DataWedge (note: the custom profile must be named “Alternative”).


The idea behind developing this utility was to allow applications to use multiple profiles without having to manually switch between profiles or integrate the logic required to programmatically switch between them (I.e. in which cases should a certain profile be applied, handling errors, validating ProfileManager XML etc…)


The application works by simply re-setting the default Profile to whichever profile is not currently set. (E.g. if the default profile is currently set, the alternative custom profile will be set instead and vice-versa). This action is performed every time the application comes to the foreground and can be mapped to any key on the device.


This utility could be used, for example, inside Enterprise Browser 2.0 to enable standard barcode scanning alongside SimulScan scanning without having the navigate away from the Browser. This is especially useful since EB 2.0 does not currently support the SimulScan API, so DataWedge is currently the only way to achieve this functionality.


You can test the application by using this Stage Now barcode:


Scanning this barcode will install a custom DW Profile (configured for a two barcode SimulScan decode via camera) as well as the utility application. The application will automatically be mapped to the PTT button so that each time the PTT button is pressed, the application comes to the foreground and switches profiles (named the default DW profile & the custom profile installed by the SN barcode). A Toast message will be displayed to notify which profile is currently active.


Source code can also be found on my GitHub and the APK can be downloaded at the bottom of this post.