Purpose
This article explains how to configure a hardware key to launch the Flashlight Manager application on Zebra Android devices using Zebra MX Configuration.
It also highlights the recommended approach of launching the application using an Intent instead of directly using the application name. Using Intent-based launching provides better reliability and compatibility in scenarios where the application name changes or is not visible to the device.
Prerequisites
- Zebra Android device with MX support
- Access to SureMDM Console or Zebra StageNow
Recommended Approach
It is recommended to launch the Flashlight Manager using an Intent instead of the application name.
Why use Intent-based launching?
- More reliable and future-proof
- Works even if the application display name changes
- Helps the device identify the target activity directly
- Reduces failures caused by app visibility or naming issues
Using Application Name Method
In some cases, customers may use the package name instead of the application name.
Example:
- Incorrect:
com.gears42.surelock.FlashlightManager - Correct:
Flashlight Manager
Sample XML
<wap-provisioningdoc>
<characteristic version=”9.2″ type=”KeyMappingMgr”>
<parm name=”Action” value=”1″ />
<characteristic type=”KeyMapping”>
<parm name=”KeyIdentifier” value=”LEFT_TRIGGER_2″ />
<characteristic type=”BaseTable”>
<parm name=”BaseBehavior” value=”4″ />
<parm name=”BaseLaunchActivityName” value=”Flashlight Manager” />
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>
Using Intent Method
Use the following XML configuration to launch Flashlight Manager using Intent.
Sample XML
<wap-provisioningdoc>
<characteristic version=”9.2″ type=”KeyMappingMgr”>
<parm name=”Action” value=”1″ />
<characteristic type=”KeyMapping”>
<parm name=”KeyIdentifier” value=”LEFT_TRIGGER_2″ />
<characteristic type=”BaseTable”>
<parm name=”BaseBehavior” value=”3″ />
<parm name=”BaseSendIntent” value=”1″ />
<parm name=”BaseIntentType” value=”1″ />
<parm name=”BaseIntentAction” value=”android.intent.action.MAIN” />
<parm name=”BaseIntentCategory” value=”android.intent.category.LAUNCHER” />
<parm name=”BaseIntentPackage” value=”com.nix” />
<parm name=”BaseIntentClass” value=”com.gears42.surelock.FlashlightManagerSettings” />
<parm name=”BaseIntentAddKeyState” value=”0″ />
<parm name=”BaseIntentIncludeFlags” value=”00000000″ />
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>
Recommended Deployment Method
Although the configuration can be deployed using a Run Script job, it is recommended to use an MX Config job instead.
Benefits of MX Config Jobs
- Better error handling
- Additional logging support
- Easier troubleshooting
- Improved deployment visibility
- Better clarity when jobs fail or go into an error state
Steps to Deploy Using SureMDM
- Log in to the SureMDM Console
- Navigate to Jobs → New Job
- Select Android → MX Config
- Upload or paste the XML configuration
- Save the job
- Deploy the job to the required Zebra devices
- Verify the hardware key behavior on the device
Conclusion
Using Intent-based launching through Zebra MX Configuration is the recommended and more reliable method for launching Flashlight Manager using hardware keys. Additionally, deploying the configuration through an MX Config job instead of a Run Script job provides better logging, improved error handling, and easier troubleshooting.
Need more help? Here’s how to get help from our experts.