GET_IGNORE_DISABLED_PROFILES
在 DataWedge 6.8 中引入。
返回 DataWedge 的“忽略已禁用的配置文件”参数的状态。如果设置为 true,则会阻止 DataWedge 切换到任何未启用的配置文件(包括 Profile0)。
函数原型
Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_IGNORE_DISABLED_PROFILES", "");
参数
ACTION [字符串]:"com.symbol.datawedge.api.ACTION"
INTENT_EXTRA [字符串]:"com.symbol.datawedge.api.GET_IGNORE_DISABLED_PROFILES"
返回值
返回一个字符串,它指示 DataWedge 是否忽略已禁用的配置文件
EXTRA NAME:"com.symbol.datawedge.api.GET_IGNORE_DISABLED_PROFILES"
可能的值:[字符串]:["true","false"]
将错误和调试消息记录到可通过 logcat 命令查看和过滤的 Android 日志记录系统。从 ADB Shell 使用 logcat 查看日志消息:
$ adb logcat -s DWAPI
记录无效操作和参数的错误消息。
示例代码
//Sample code for sending the intent to GET the setting Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_IGNORE_DISABLED_PROFILES",""); // request and identify the result code i.putExtra("SEND_RESULT","true"); i.putExtra("COMMAND_IDENTIFIER","123456789");//user specified unique id this.sendBroadcast(i); // Register/unregister broadcast receiver and filter results void registerReceivers() { IntentFilter filter = new IntentFilter(); filter.addAction("com.symbol.datawedge.api.RESULT_ACTION"); filter.addCategory("android.intent.category.DEFAULT"); registerReceiver(mybroadcastReceiver, filter); } void unRegisterReceivers(){ unregisterReceiver(mybroadcastReceiver); }
接收 GET/SET 的结果
// Register/unregister broadcast receiver and filter results void registerReceivers() { IntentFilter filter = new IntentFilter(); filter.addAction("com.symbol.datawedge.api.RESULT_ACTION"); filter.addCategory("android.intent.category.DEFAULT"); registerReceiver(mybroadcastReceiver, filter); } void unRegisterReceivers(){ unregisterReceiver(mybroadcastReceiver); } //receiving the results BroadcastReceiver resultReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String command = intent.getStringExtra("COMMAND"); String commandIdentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle; String resultInfo = ""; if(intent.hasExtra("RESULT_INFO")){ bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key: keys) { Object object = bundle.get(key); if(object instanceof String){ resultInfo += key + ": "+object+ "\n"; } else if(object instanceof String[]){ String[] codes = (String[])object; for(String code : codes){ resultInfo += key + ": "+code+ "\n"; } } } } String text = "Command: "+command+"\n" + "Result: " +result+"\n" + "Result Info: " +resultInfo + "\n" + "CID:"+commandIdentifier; Log.d(TAG,text); } };
另请参阅:
Zebra 支持中心 | 集成商指南、产品手册、软件下载和支持
LaunchPad | Zebra 开发人员社区
Intent | Android 开发人员
Intent 和 Intent 过滤器 | Android 开发人员
Android Intent | 教程