GET_CONFIG
指定したプロファイルの PARAM_LIST 設定を取得します。この設定は、値ペアのセットまたはプラグイン構成バンドルとして返されます。
バージョン履歴
- DataWedge 6.5 で導入
- DataWedge 6.8 - ADF 設定のサポートを追加
- DataWedge 6.9/7.0 - 音声入力およびグローバル スキャナ構成のサポートを追加
- DataWedge 7.1 - フル プロファイル、Data Capture Plus (DCP) 、磁気ストライプ リーダー (MSR)、インターネット プロトコル (IP)、SimulScan の構成のサポートを追加
- DataWedge 7.3.22 - 新しい RFID 入力機能のサポートを追加
- DataWedge 7.4.44 - 新しいエンタープライズ キーボード構成の機能
関数プロトタイプ
Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", "<profile name>");
パラメータ
ACTION [string]: "com.symbol.datawedge.api.ACTION"
EXTRA_DATA [string]: "com.symbol.datawedge.api.GET_CONFIG"
EXTRA VALUE [bundle]: "<PROFILE_NAME>", "<PLUGIN_CONFIG>"
PLUGIN_CONFIG[bundle] -PLUGIN_NAME[string] - 単一プラグイン名 (「barcode」など) またはプラグイン名の配列リスト:PROCESS_PLUGIN_NAME[list of bundles] - 例:PLUGIN_NAME- "ADF"、"BDF"OUTPUT_PLUGIN_NAME- "KEYSTROKE"- ...
PLUGIN_NAME- "BDF"OUTPUT_PLUGIN_NAME- "INTENT"
注:
- 処理プラグイン (ADF および BDF) を照会するには、PROCESS_PLUGIN_NAME パラメータを使用する必要があります。デフォルトの GET_CONFIG インテントでは、処理プラグインに関する情報を取得できません。
- 存在しない値は空のエクストラとして返されます。
スキャナ識別子: デバイスでサポートされている各スキャナのスキャナ情報バンドルに存在します。インデックス パラメータと識別子パラメータは、どちらも DataWedge 6.6 以降でサポートされています。コードでインデックスも参照されている場合、スキャナ識別子の値が優先されます。
scanner_selection_by_identifier[string] - 以下のスキャナ識別子のリストから値を取得します。- AUTO - スキャナ自動選択
- INTERNAL_IMAGER - 内蔵イメージャ スキャナ
- INTERNAL_LASER - 内蔵レーザー スキャナ
- INTERNAL_CAMERA - 内蔵カメラ スキャナ
- SERIAL_SSI ET50/ET55 用のプラグ接続可能な Z バック スキャナ
- BLUETOOTH_SSI - RS507 Bluetooth スキャナ
- BLUETOOTH_RS6000 - RS6000 Bluetooth スキャナ
- BLUETOOTH_DS3678 - DS3678 Bluetooth スキャナ
- PLUGABLE_SSI - シリアル SSI スキャナ RS429 (WT6000 用)
- PLUGABLE_SSI_RS5000 - シリアル SSI スキャナ RS5000 (WT6000 用)
- USB_SSI_DS3608 - DS3608 プラグ接続可能 USB スキャナ
戻り値
プロファイル名、ステータス、およびプロファイル構成バンドル (PARAM_LIST バンドルを含む) とともに、ネストされたバンドルを返します。
EXTRA NAME: "com.symbol.datawedge.api.GET_CONFIG_RESULT"
BUNDLE: <メイン バンドル> (以下のパラメータを参照)
メイン バンドル
メインの Get_Result_Config Bundle には、次のプロパティが含まれています。
PROFILE_NAME [string]: 照会されるプロファイルの名前
PROFILE_ENABLED [string]: True/False
PLUGIN_CONFIG [bundle]: 次のプロパティを含むネストされたBundle:
- PLUGIN_NAME [string]: レポートされるプラグインの名前 (Barcode など)
- PARAM_LIST [bundle]: 名前と値のペアのネストされたリスト。例:
- current-device-index、0
- Aztec、True
- Canadian_Postal、False
- Code11、Null (デフォルトにリセット)
- ピックリスト、ハードウェア
- エイム タイプ、PRESS_AND_RELEASE
- ...(その他)
コード例
GET_CONFIG インテントの送信
Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "DWDemo"); Bundle bConfig = new Bundle(); ArrayList<Bundle> pluginName = new ArrayList<>(); Bundle pluginInternal = new Bundle(); pluginInternal.putString("PLUGIN_NAME", "ADF");//can put a list "ADF,BDF" pluginInternal.putString("OUTPUT_PLUGIN_NAME","KEYSTROKE"); pluginName.add(pluginInternal); bConfig.putParcelableArrayList("PROCESS_PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i);
GET_CONFIG 結果の受信
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); Set<String> keys = extras.keySet(); for(String key: keys){ Log.d(TAG,"key:"+key); } if (extras.containsKey("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle bundle = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); if(bundle != null && !bundle.isEmpty()){ String profileName = bundle.getString("PROFILE_NAME"); String profileEnabled = bundle.getString("PROFILE_ENABLED"); ArrayList<Bundle> configBundleList = bundle.getParcelableArrayList("PLUGIN_CONFIG"); if(configBundleList!=null) { for (Bundle configBundle : configBundleList) { String pluginName = configBundle.getString("PLUGIN_NAME"); Log.d(TAG, "\n Plugin Name :" + pluginName); if (pluginName!=null && pluginName.equalsIgnoreCase("ADF")) { String pluginEnabled = configBundle.getString("adf_enabled"); Log.d(TAG, " Plugin Enabled :" + pluginEnabled); if(configBundle.containsKey("PARAM_LIST")){ Object object = configBundle.get("PARAM_LIST"); if(object!=null && object instanceof ArrayList){ ArrayList<Bundle> paramArrayList = (ArrayList)object; for(Bundle rule : paramArrayList){ String name = rule.getString("name"); String enabled = rule.getString("enabled"); String priority = rule.getString("priority"); String alldevices = rule.getString("alldevices"); String string = rule.getString("string"); String stringPos = rule.getString("string_pos"); String stringLen = rule.getString("string_len"); Log.d(TAG, "Rule ->"); Log.d(TAG, " name :" + name); Log.d(TAG, " enabled :" + enabled); Log.d(TAG, " priority :" + priority); Log.d(TAG, " alldevices :" + alldevices); Log.d(TAG, " string :" + string); Log.d(TAG, " stringPos :" + stringPos); Log.d(TAG, " stringLen :" + stringLen); ArrayList<Bundle> actions = rule.getParcelableArrayList("ACTIONS"); if(actions!=null){ Log.d(TAG,"\n Actions->"); for(Bundle action: actions){ String type = action.getString("type"); Object param_1 = action.get("action_param_1"); Object param_2 = action.get("action_param_2"); Object param_3 = action.get("action_param_3"); Log.d(TAG," type:"+type); if(param_1!=null && param_1 instanceof String){ Log.d(TAG," param_1:"+param_1); } if(param_2!=null && param_2 instanceof String){ Log.d(TAG," param_2:"+param_2); } if(param_3!=null && param_3 instanceof String){ Log.d(TAG," param_3:"+param_3); } } } ArrayList<Bundle> devices = rule.getParcelableArrayList("DEVICES"); if(devices!=null){ Log.d(TAG,"\n Devices->"); for(Bundle device: devices){ String type = device.getString("device_id"); Object param_1 = device.get("enabled"); Object param_2 = device.get("alldecoders"); Object param_3 = device.get("all_label_ids"); Log.d(TAG," Device ID:"+type); if(param_1!=null && param_1 instanceof String){ Log.d(TAG," Enabled:"+param_1); } if(param_2!=null && param_2 instanceof String){ Log.d(TAG," All decoders:"+param_2); } if(param_3!=null && param_3 instanceof String){ Log.d(TAG," All labelids:"+param_3); } } } ArrayList<Bundle> decoders = rule.getParcelableArrayList("DECODERS"); if(decoders!=null){ Log.d(TAG,"\n Decoders->"); for(Bundle decoder: decoders){ String deviceID = decoder.getString("device_id"); String decoderEnabled = decoder.getString("enabled"); String decoderID = decoder.getString("decoder"); Log.d(TAG," Device ID:"+deviceID); Log.d(TAG," Decoder Enabled:"+decoderEnabled); Log.d(TAG," Decoder ID:"+decoderID); } } ArrayList<Bundle> labelIDs = rule.getParcelableArrayList("LABEL_IDS"); if(labelIDs!=null){ Log.d(TAG,"\n LabelIDs->"); for(Bundle labelID: labelIDs){ String deviceID = labelID.getString("device_id"); String lblEnabled = labelID.getString("enabled"); String lblID = labelID.getString("label_id"); Log.d(TAG," Device ID:"+deviceID); Log.d(TAG," Label Enabled:"+lblEnabled); Log.d(TAG," Label ID:"+lblID); } } } } } } }
プラグインの取得
// SENDING THE INTENT Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile0 (default)"); Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("BARCODE"); // pluginName.add("INTENT"); to add more plugins bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); // RECEIVING THE RESULT private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle result = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = result.keySet(); for (String key : keys) { if (!key.equalsIgnoreCase("PLUGIN_CONFIG")) { Log.d("DWScannerConfig", "DWGetConfig::level-1: " + key + " : " + result.getString(key)); } else { ArrayList<Bundle> bundleArrayList = result.getParcelableArrayList("PLUGIN_CONFIG"); for(Bundle configBundle:bundleArrayList){ Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { //TODO consume the params } } } } } } } } };
アプリの関連付けの取得
// SENDING THE INTENT selectedProfileName = "DWDemo"; Bundle bConfig = new Bundle(); bConfig.putString("PROFILE_NAME", selectedProfileName); bConfig.putString("APP_LIST", "");//empty Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bConfig); this.sendBroadcast(i); // RECEIVING THE RESULT private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "Action: " + action); if(action.equals("com.symbol.datawedge.api.RESULT_ACTION")){ Bundle b = intent.getExtras(); // getConfig result if(intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle res = b.getBundle("com.symbol.datawedge.api.RESULT_GET_CONFIG"); if(!res.isEmpty()) { String profileName = res.getString("PROFILE_NAME"); Log.d(TAG, "GET_CONFIG profileName: " + profileName); ArrayList<Bundle> appList = res.getParcelableArrayList("APP_LIST"); if(appList == null){ Log.d(TAG,"Profile information is not found for "+profileName); }else if(appList.size() == 0){ Log.d(TAG,"Profile "+profileName+" has no associated information"); }else { for(Bundle b1 :appList ){ Log.d(TAG,b1.getString("PACKAGE_NAME")+":"+b1.getStringArrayList("ACTIVITY_LIST")); } } } } } } };
スキャナ ステータスの取得
// SENDING THE INTENT Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_SCANNER_STATUS","STANDARD"); i.putExtra("SEND_RESULT","LAST_RESULT"); // i.putExtra("SEND_RESULT", "true"); // For versions prior to DataWedge 7.1 i.putExtra("com.symbol.datawedge.api.RESULT_CATEGORY","android.intent.category.DEFAULT"); this.sendBroadcast(i); // RECEIVING THE RESULT private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver(){ @Override public void onReceive(Context context, Intent intent){ if (intent != null) { String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { resultInfo += key + ": " + bundle.getString(key) + "\n"; } } String text = "Command: " + command + "\n" + "Result: " + result + "\n" + "Result Info: \n" + resultInfo + "\n" + "CID:" + commandidentifier; Log.d("TAG", "#DataWedgeTestApp# \nCommand: " + command + "\nResult: " + result + "\nReason:\n" + resultInfo); Toast.makeText(context, text, Toast.LENGTH_LONG).show(); } }; };
スキャナ詳細の取得
//Bundle extras = intent.getExtras(); if (intent.hasExtra(RESULT_ACTION_EXTRA_GET_CONFIG)) { Bundle results = intent.getBundleExtra(RESULT_ACTION_EXTRA_GET_CONFIG); if(results!=null){ if(results.containsKey(BUNDLE_EXTRA_PLUGIN_CONFIG)){ ArrayList<Bundle> list = (ArrayList<Bundle>)results.get(BUNDLE_EXTRA_PLUGIN_CONFIG); Bundle x = new Bundle(); if(list!=null){ for(Bundle it : list){ if(it.containsKey(BUNDLE_EXTRA_PARAM_LIST)){ Bundle b =(Bundle)it.get(BUNDLE_EXTRA_PARAM_LIST); String sEnabled = b.getString("scanner_input_enabled"); String sSelection = b.getString("scanner_selection"); String sSelectionId = b.getString("scanner_selection_by_identifier"); String sType = b.getString("scanner_type"); Log.d(TAG,"scanner_selection : "+sSelection); Log.d(TAG,"scanner_selection_by_identifier : "+sSelectionId); } } } } } }
バーコード パラメータの取得
指定したプロファイルからデバイスのサポートされているバーコード パラメータを取得します。サポートされているバーコード パラメータのリストと現在の値を返します。バーコード パラメータがリストされていない場合は、デバイスでサポートされていないことを意味します。
public void getScannerConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile0 (default)"); Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("BARCODE"); bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setPackage("com.symbol.datawedge"); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { if(configBundle.getString("PLUGIN_NAME") != null) { strFinalResult += "\nPlugin " + configBundle.getString("PLUGIN_NAME") + " Settings\n"; } for (String configBundleKey : configBundle.keySet()) { if (configBundleKey.equalsIgnoreCase("PARAM_LIST")) { Bundle paramBundle1 = configBundle.getBundle("PARAM_LIST"); if (paramBundle1 != null) { for (String paramKey : paramBundle1.keySet()) { strFinalResult += "\n\t" + paramKey + ": " + paramBundle1.get(paramKey); } } } } strFinalResult += "\n"; } } } final String status = "Get config info received\n" + strFinalResult; Log.d("TAG", "#IntentApp#\n\n" + status); } } } };
コードからの出力例:
Get config info received Plugin BARCODE Settings decoder_code128_enable_ean128: true decoder_code39_full_ascii: false decoder_i2of5_check_digit: 0 decoder_i2of5_security_level: 1 decoder_code128_check_isbt_table: false linear_security_level: 1 upcean_retry_count: 10 upcean_bookland_format: 0 ocr_check_digit_multiplier: 121212121212 decoder_msi_check_digit: 0 decoder_grid_matrix_mirror: 0 decoder_msi_reduced_quiet_zone: false decoder_msi_check_digit_scheme: 0 decoder_d2of5_redundancy: true beam_timer: 5000 code128_enable_marginless_decode: false trigger_wakeup_scan: false instant_reporting_enable: false decoder_code128_redundancy: false decoder_dotcode_mirror: 2 decoder_signature: false databar_to_upc_ean: false decoder_grid_matrix: false decoder_codabar_notis_editing: false decoder_australian_postal: false decoder_upca_preamble: 1 scanner_selection: auto upcean_ean_zero_extend: false ocr_lines: 1 decoder_code93_length1: 0 decoder_code93_length2: 55 decoder_msi_length1: 4 decoder_msi_length2: 55 decoder_uspostnet: false doc_capture_template: None enable_udi_iccbba: true decoder_code128_enable_plain: true multi_barcode_count: 5 inverse_ocr: 0 decoder_code11_verify_check_digit: 1 ocr_b_variant: 0 ocr_quiet_zone: 50 decoder_code128_isbt128_concat_mode: 0 decoder_ean8: true decoder_upca: true auto_switch_to_default_on_event: 0 report_decoded_barcodes: false decoder_matrix_2of5_verify_check_digit: true inverse_1d_mode: 0 decoder_signature_bpp: 2 decoder_codabar_length1: 6 decoder_codabar_length2: 55 aim_mode: on aim_type: 0 decoder_i20f5_enable_febraban: false decoder_code93_redundancy: false decoder_hanxin_inverse: 0 decoder_signature_width: 400 decoder_aztec: true decoder_d2of5: false decoder_ean13: true decoder_i2of5: false decoder_ocr_a: false decoder_ocr_b: false decoder_tlc39: false decoder_upce0: true decoder_upce1: false decoder_upca_report_check_digit: true auto_charset_failure_option: UTF-8 picklist: 0 enable_udi_hibcc: true SCANNER_STATUS: CONNECTED decoder_trioptic39: false decoder_uspostnet_report_check_digit: false decoder_upce0_convert_to_upca: false decoder_dutch_postal_3S: false decoder_mailmark: true decoder_gs1_datamatrix: false decoder_code39_security_level: 1 decoder_code11_length1: 4 decoder_code11_length2: 55 decoder_i2of5_length1: 6 decoder_i2of5_length2: 55 decoder_usplanet: false decoder_code11_report_check_digit: false volume_slider_type: 3 decoder_gs1_lim_security_level: 2 decoder_uk_postal: false upcean_security_level: 1 code39_enable_marginless_decode: false barcode_trigger_mode: 1 decoder_uk_postal_report_check_digit: false decoder_codabar_redundancy: true 1d_marginless_decode_effort_level: 1 decoder_dutch_postal: false decoder_i2of5_redundancy: true decoder_matrix_2of5_report_check_digit: true low_power_timeout: 250 aim_timer: 500 lcd_mode: 0 code128_ignore_fnc4: false decoder_composite_c: false decoder_code128_length1: 0 decoder_code128_length2: 55 decode_screen_time: 1000 decoder_maxicode: true good_decode_led_timer: 75 poor_quality_bcdecode_effort_level: 0 decoder_grid_matrix_inverse: 0 decoder_gs1_qrcode: false upcean_supplemental2: true upcean_supplemental5: true decode_haptic_feedback: false ocr_check_digit_modulus: 1 upcean_bookland: false different_barcode_timeout: 500 ocr_orientation: 0 decoder_codabar_clsi_editing: false decoder_code39_verify_check_digit: false decoder_matrix_2of5_redundancy: false decoder_us4state_fics: false decode_audio_feedback_uri: content://media/internal/audio/media/186 decoder_matrix_2of5_length1: 10 decoder_matrix_2of5_length2: 0 decoder_gs1_databar: true decoder_chinese_2of5: false decoder_matrix_2of5: false same_barcode_timeout: 500 decoder_us_currency: false illumination_mode: torch decoder_code39_convert_to_code32: false decoder_codabar: true decoder_code128: true decoder_finnish_pos
バーコード強調パラメータを取得します
プロファイルで指定されたバーコード強調ルールから、バーコード強調パラメータを取得します。サポートされているパラメータと現在の値のリストを返します。
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String strFinalResult = ""; if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys){ if (key.equalsIgnoreCase("PLUGIN_CONFIG")){ ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList){ String pluginName = configBundle.getString("PLUGIN_NAME"); if(pluginName != null && pluginName.equalsIgnoreCase("BARCODE")){ Bundle b = configBundle.getBundle("PARAM_LIST"); strFinalResult += "\n Profile name: "+ profileName; for (String bkey:b.keySet()) { if(bkey.equalsIgnoreCase("barcode_highlighting_rules")){ strFinalResult +="\n" + bkey + ": " + processRulesBundle(b.getParcelableArrayList(bkey)); }else { strFinalResult += "\n" + bkey + ": " + b.get(bkey) + ""; } } } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } } } } }; private String processRulesBundle(ArrayList<Bundle> rulesBundleList){ String result = ""; if(rulesBundleList!= null && !rulesBundleList.isEmpty()) { for (Bundle rule : rulesBundleList) { String paramID = rule.getString("rule_param_id"); ArrayList<Bundle> ruleParamList = rule.getParcelableArrayList("rule_list"); if (ruleParamList != null && !ruleParamList.isEmpty()) { result += "\n\t" + "rule_param_id" + ": " + paramID + ""; result += "\n\t" + "rules_list" + ": " + processRuleParamBundle(ruleParamList); } } } return result; } private String processRuleParamBundle(ArrayList<Bundle> ruleParamList){ String result = ""; for(Bundle ruleParam: ruleParamList){ String ruleName = ruleParam.getString("rule_name"); result += "\n\t\t" + "rule_name" + ": " + ruleName +""; Bundle criteriaBundle = ruleParam.getBundle("criteria"); ArrayList<Bundle> actionBundleList = ruleParam.getParcelableArrayList("actions"); if(criteriaBundle!= null){ result+= "\n\t\t" + "criteria" + ": " +processCriteriaBundle(criteriaBundle); } if(actionBundleList!= null){ result+= "\n\t\t" + "actions" + ": " +processActionBundle(actionBundleList); } } return result; } private String processActionBundle(ArrayList<Bundle> actionBundleList){ String result = ""; for(Bundle actionBundle: actionBundleList){ String actionKey = actionBundle.getString("action_key"); String actionValue = actionBundle.getString("action_value"); result+= "\n\t\t\t" + "action_key" + ": " + actionKey +" , action_value"+": "+actionValue; } return result; } private String processCriteriaBundle(Bundle criteriaBundle){ String result = ""; for (String key : criteriaBundle.keySet()){ Object object = criteriaBundle.get(key); if(object instanceof ArrayList){ result+= "\n\t\t\t" + "criteria_key" + ": " + key +" , criteria_value"+": "; ArrayList<Bundle> bundleArrayList = criteriaBundle.getParcelableArrayList(key); for (Bundle bundle: bundleArrayList){ String criteriaKey = bundle.getString("criteria_key"); String criteriaValue = bundle.getString("criteria_value"); result+= "\n\t\t\t\t" + "criteria_key" + ": " + criteriaKey +" , criteria_value"+": " +criteriaValue; } }else if(object instanceof String[]){ String[] valueArray = criteriaBundle.getStringArray(key); if(valueArray!= null){ String value = Arrays.toString(valueArray); //result+= value; result+= "\n\t\t\t" + "criteria_key" + ": " + key +" , criteria_value"+": " +value ; } } } return result; }
ワークフロー入力構成の取得
OCR Wedge (ナンバー プレート、身分証明書、車両識別番号、タイヤ識別番号、メーター) およびイメージ キャプチャから次のワークフロー入力パラメータを取得します。
public void getConfig() { Intent i = new Intent(); Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Demo"); Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("WORKFLOW"); bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); i.setPackage("com.symbol.datawedge"); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("APPLICATION_PACKAGE", getPackageName()); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } // Broadcast Receiver BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String strFinalResult = ""; if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys){ if (key.equalsIgnoreCase("PLUGIN_CONFIG")){ ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList){ String pluginName = configBundle.getString("PLUGIN_NAME"); if (pluginName != null && pluginName.equalsIgnoreCase("WORKFLOW")){ ArrayList<Bundle> paramBundle = configBundle.getParcelableArrayList("PARAM_LIST"); strFinalResult += "\n Profile name: "+ profileName; for (Bundle workflow:paramBundle) { for (String wkey:workflow.keySet()) { if(wkey.equalsIgnoreCase("workflow_name")) { strFinalResult += "\n" + wkey + ": " + workflow.get(wkey) + ""; } if(wkey.equalsIgnoreCase("workflow_input_source")) { strFinalResult += "\n" + wkey + ": " + workflow.get(wkey) + ""; } else if(wkey.equalsIgnoreCase("workflow_params")) { ArrayList<Bundle> moduleParams = workflow.getParcelableArrayList("workflow_params"); for (Bundle module:moduleParams) { strFinalResult += "\n module: " + module.get("module") ; for (String mkey:module.keySet()) { if(mkey.equalsIgnoreCase("module_params")) { Bundle moduleParams1 = module.getBundle(mkey); for (String pkey:moduleParams1.keySet()) { String value = moduleParams1.getString(pkey); strFinalResult += "\n\t\t" + pkey + ": " + value; } } } } } } } } else if(pluginName != null && pluginName.equalsIgnoreCase("BARCODE")){ Bundle b = configBundle.getBundle("PARAM_LIST"); for (String bkey:b.keySet()) { if(bkey.equalsIgnoreCase("barcode_highlighting_rules")){ strFinalResult +="\n" + bkey + ": " + processRulesBundle(b.getParcelableArrayList(bkey)); }else { strFinalResult += "\n" + bkey + ": " + b.get(bkey) + ""; } } } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } } } } }; private String processRulesBundle(ArrayList<Bundle> rulesBundleList){ String result = ""; if(rulesBundleList!= null && !rulesBundleList.isEmpty()) { for (Bundle rule : rulesBundleList) { String paramID = rule.getString("rule_param_id"); ArrayList<Bundle> ruleParamList = rule.getParcelableArrayList("rule_list"); if (ruleParamList != null && !ruleParamList.isEmpty()) { result += "\n\t" + "rule_param_id" + ": " + paramID + ""; result += "\n\t" + "rules_list" + ": " + processRuleParamBundle(ruleParamList); } } } return result; } private String processRuleParamBundle(ArrayList<Bundle> ruleParamList){ String result = ""; for(Bundle ruleParam: ruleParamList){ String ruleName = ruleParam.getString("rule_name"); result += "\n\t\t" + "rule_name" + ": " + ruleName +""; Bundle criteriaBundle = ruleParam.getBundle("criteria"); ArrayList<Bundle> actionBundleList = ruleParam.getParcelableArrayList("actions"); if(criteriaBundle!= null){ result+= "\n\t\t" + "criteria" + ": " +processCriteriaBundle(criteriaBundle); } if(actionBundleList!= null){ result+= "\n\t\t" + "actions" + ": " +processActionBundle(actionBundleList); } } return result; } private String processActionBundle(ArrayList<Bundle> actionBundleList){ String result = ""; for(Bundle actionBundle: actionBundleList){ String actionKey = actionBundle.getString("action_key"); String actionValue = actionBundle.getString("action_value"); result+= "\n\t\t\t" + "action_key" + ": " + actionKey +" , action_value"+": "+actionValue; } return result; } private String processCriteriaBundle(Bundle criteriaBundle){ String result = ""; for (String key : criteriaBundle.keySet()){ Object object = criteriaBundle.get(key); if(object instanceof ArrayList){ result+= "\n\t\t\t" + "criteria_key" + ": " + key +" , criteria_value"+": "; ArrayList<Bundle> bundleArrayList = criteriaBundle.getParcelableArrayList(key); for (Bundle bundle: bundleArrayList){ String criteriaKey = bundle.getString("criteria_key"); String criteriaValue = bundle.getString("criteria_value"); result+= "\n\t\t\t\t" + "criteria_key" + ": " + criteriaKey +" , criteria_value"+": " +criteriaValue; } }else if(object instanceof String[]){ String[] valueArray = criteriaBundle.getStringArray(key); if(valueArray!= null){ String value = Arrays.toString(valueArray); //result+= value; result+= "\n\t\t\t" + "criteria_key" + ": " + key +" , criteria_value"+": " +value ; } } } return result; }
文字間設定の取得
private Integer ctrlCharacterDelayValue; private Integer genericCharacterDelayValue; private Boolean flagExtendedASCIIOnly; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); registerReceivers(); ctrlCharacterDelayValue = null; genericCharacterDelayValue = null; flagExtendedASCIIOnly = null; } private void registerReceivers() { IntentFilter filter = new IntentFilter(); filter.addAction("com.symbol.datawedge.api.RESULT_ACTION"); filter.addCategory(Intent.CATEGORY_DEFAULT); registerReceiver(broadcastReceiver, filter); } @Override protected void onDestroy() { super.onDestroy(); unregisterReceiver(broadcastReceiver); } //Get configuration public void getKeyStrokeConfiguration(View arg){ Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME","Profile0 (default)"); Bundle bConfig = new Bundle(); bConfig.putString("PLUGIN_NAME","KEYSTROKE"); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } //broadcast receiver private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "#DataWedge-APP# Action: " + action); //result of get config if(intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")){ Bundle bundle = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); if(bundle != null && !bundle.isEmpty()){ String profileName = bundle.getString("PROFILE_NAME"); String profileEnabled = bundle.getString("PROFILE_ENABLED"); ArrayList<Bundle> configBundleList = bundle.getParcelableArrayList("PLUGIN_CONFIG"); if(configBundleList!=null) { for (Bundle configBundle : configBundleList) { if (configBundle.getString("PLUGIN_NAME").equalsIgnoreCase("KEYSTROKE")) { Bundle paramBundle = configBundle.getBundle("PARAM_LIST"); String keyStrokePluginEnabled = paramBundle.getString("keystroke_output_enabled"); String mExtendedAsciiDelay = paramBundle.getString("keystroke_delay_extended_ascii"); String mCtrlDelay = paramBundle.getString("keystroke_delay_control_chars"); String actionKeyChar = paramBundle.getString("keystroke_action_char"); Log.d(TAG, " ProfileName :" + profileName); Log.d(TAG, " Profile enabled :" + profileEnabled); Log.d(TAG, " Plugin enabled :" + keyStrokePluginEnabled); Log.d(TAG, " Ctrl Char Delay :" + mCtrlDelay); Log.d(TAG, " Character Delay :" + mExtendedAsciiDelay); Log.d(TAG, " ActionKey Char :" + actionKeyChar); } } } } }//end get config }//end onRecieve };
TOKEN 処理設定の取得
public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); Bundle processPlugin_TOKEN_IP = new Bundle(); processPlugin_TOKEN_IP.putString("PLUGIN_NAME", "TOKEN"); processPlugin_TOKEN_IP.putString("OUTPUT_PLUGIN_NAME", "KEYSTROKE"); // Tokens are supported only in KEYSTROKE and IP plugins only, for others empty bundle will be returned. bConfig.putBundle("PROCESS_PLUGIN_NAME", processPlugin_TOKEN_IP); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if (val == null) { if (bundle.getStringArray(key) != null) { val = ""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { String pluginName = configBundle.getString("PLUGIN_NAME"); strFinalResult += "\nPlugin " + pluginName + " Settings\n"; if (pluginName != null && pluginName.equalsIgnoreCase("TOKEN")) { strFinalResult += "\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " TOKEN Settings\n"; Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { if (key3.equalsIgnoreCase("token_order")) { strFinalResult += "\n" + key3 + ": token_order\n"; ArrayList<Bundle> tokenOrderList = params.getParcelableArrayList("token_order"); int order = 0; for (Bundle b : tokenOrderList) { strFinalResult += "\t" + order + ". " + b.getString("name") + ": " + b.getString("enabled") + "\n"; order++; } } else { strFinalResult += "\n" + key3 + ": " + params.get(key3); } } } } strFinalResult += "\n"; } } } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG", "#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
ワークフロー データ出力の取得
public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); Bundle processPlugin_TOKEN_IP = new Bundle(); processPlugin_TOKEN_IP.putString("PLUGIN_NAME", "TOKEN"); processPlugin_TOKEN_IP.putString("OUTPUT_PLUGIN_NAME", "KEYSTROKE"); // Tokens are supported only in KEYSTROKE and IP plugins only, for others empty bundle will be returned. bConfig.putBundle("PROCESS_PLUGIN_NAME", processPlugin_TOKEN_IP); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if (val == null) { if (bundle.getStringArray(key) != null) { val = ""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { String pluginName = configBundle.getString("PLUGIN_NAME"); strFinalResult += "\nPlugin " + pluginName + " Settings\n"; if (pluginName != null && pluginName.equalsIgnoreCase("TOKEN")) { strFinalResult += "\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " TOKEN Settings\n"; Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { if (key3.equalsIgnoreCase("token_order")) { strFinalResult += "\n" + key3 + ": gs1_token_order\n"; ArrayList<Bundle> tokenOrderList = params.getParcelableArrayList("token_order"); int order = 0; for (Bundle b : tokenOrderList) { strFinalResult += "\t" + order + ". " + b.getString("name") + ": " + b.getString("enabled") + "\n"; order++; } } else { strFinalResult += "\n" + key3 + ": " + params.get(key3); } } } } strFinalResult += "\n"; } } } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG", "#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
GS1 TOKEN 処理設定の取得
public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); Bundle processPlugin_TOKEN_IP = new Bundle(); processPlugin_TOKEN_IP.putString("PLUGIN_NAME", "TOKEN"); processPlugin_TOKEN_IP.putString("OUTPUT_PLUGIN_NAME", "KEYSTROKE"); // Tokens are supported only in KEYSTROKE and IP plugins only, for others empty bundle will be returned. bConfig.putBundle("PROCESS_PLUGIN_NAME", processPlugin_TOKEN_IP); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if (val == null) { if (bundle.getStringArray(key) != null) { val = ""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { String pluginName = configBundle.getString("PLUGIN_NAME"); strFinalResult += "\nPlugin " + pluginName + " Settings\n"; if (pluginName != null && pluginName.equalsIgnoreCase("TOKEN")) { strFinalResult += "\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " TOKEN Settings\n"; Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { if (key3.equalsIgnoreCase("gs1_token_order")) { strFinalResult += "\n" + key3 + ": gs1_token_order\n"; ArrayList<Bundle> tokenOrderList = params.getParcelableArrayList("gs1_token_order"); int order = 0; for (Bundle b : tokenOrderList) { strFinalResult += "\t" + order + ". " + b.getString("name") + ": " + b.getString("enabled") + "\n"; order++; } } else { strFinalResult += "\n" + key3 + ": " + params.get(key3); } } } } strFinalResult += "\n"; } } } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG", "#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
RFID 入力構成の取得
private void getIntentConfigRFID() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "SampleConfigApi"); Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("RFID"); bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } // BroadcastReceiver to handle incoming data private BroadcastReceiver reciveResulyBroadcast = new BroadcastReceiver(){ @Override public void onReceive(Context context, Intent intent) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle result = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = result.keySet(); for (String key : keys) { ; if (!key.equalsIgnoreCase("PLUGIN_CONFIG")) { Log.d("DWScannerConfig", "DWGetConfig::level-1: " + key + " : " + result.getString(key)); } else { ArrayList<Bundle> bundleArrayList = result.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); String configs =intentData.getText()+"\n\n\n" +configBundle.getString("PLUGIN_NAME")+"\n"; for (String key3 : keys3) { configs+= key3+"="+params.getString(key3)+"\n"; } intentData.setText(configs); } } } } } } } }
SERIAL 入力構成の取得
final String RESULT_ACTION = "com.symbol.datawedge.api.RESULT_ACTION"; final static String DEFAULT_CATEGORY = "android.intent.category.DEFAULT"; TextView status; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); IntentFilter filter = new IntentFilter(); filter.addAction(RESULT_ACTION); filter.addCategory(DEFAULT_CATEGORY); registerReceiver(dwResultReciever, filter); } public void btnGetOnClick(View view) { status.setText(""); //MAIN BUNDLE PROPERTIES Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile0 (default)"); //bMain.putString("PROFILE_NAME", "DWDemo"); //PLUGIN_CONFIG BUNDLE PROPERTIES Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("SERIAL"); bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("SEND_RESULT","LAST_RESULT"); // i.putExtra("SEND_RESULT", "true"); // For versions prior to DataWedge 7.1 i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver dwResultReciever = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String text = ""; if (intent.getAction().equalsIgnoreCase("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle bundle = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); if (bundle != null && !bundle.isEmpty()) { String profileName = bundle.getString("PROFILE_NAME"); String profileEnabled = bundle.getString("PROFILE_ENABLED"); ArrayList<Bundle> configBundleList = bundle.getParcelableArrayList("PLUGIN_CONFIG"); if (configBundleList != null) { for (Bundle configBundle : configBundleList) { if (configBundle.getString("PLUGIN_NAME").equalsIgnoreCase("SERIAL")) { Parcelable[] deviceBundleList = configBundle.getParcelableArray("DEVICE_LIST"); for (Parcelable parcelableDevice : deviceBundleList) { Bundle device = (Bundle) parcelableDevice; Log.d("TAG", "#Serial# " + device.getString("serial_port_id")); Log.d("TAG", "#Serial# " + device.getString("serial_input_enabled")); Log.d("TAG", "#Serial# " + device.getString("serial_baudrate")); Log.d("TAG", "#Serial# " + device.getString("serial_databits")); Log.d("TAG", "#Serial# " + device.getString("serial_parity")); Log.d("TAG", "#Serial# " + device.getString("serial_stopbits")); Log.d("TAG", "#Serial# " + device.getString("serial_flow")); } } } } } } status.setText("Status:\n" + text); } } };
SIMULSCAN 入力構成の取得
public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); ArrayList<String> pluginName = new ArrayList<>(); pluginName.add("SIMULSCAN"); bConfig.putStringArrayList("PLUGIN_NAME", pluginName); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if(val == null) { if(bundle.getStringArray(key) != null) { val=""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { strFinalResult += "\nPlugin " + configBundle.getString("PLUGIN_NAME") + " Settings\n"; for (String configBundleKey : configBundle.keySet()) { if (configBundleKey.equalsIgnoreCase("PARAM_LIST")) { Bundle params = configBundle.getBundle("PARAM_LIST"); for (String paramKey : params.keySet()) { if(paramKey.equalsIgnoreCase("simulscan_template_params")) { Bundle simulscan_template_params = params.getBundle("simulscan_template_params"); if (simulscan_template_params != null) { strFinalResult += "\n\tDynamic template params"; for (String template_param : simulscan_template_params.keySet()) { strFinalResult += "\n\t\t" + template_param + ": " + simulscan_template_params.get(template_param); } } } else { strFinalResult += "\n\t" + paramKey + ": " + params.get(paramKey); } } } } strFinalResult += "\n"; } } } Log.d("TAG","#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG","#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
DCP 入力構成の取得
// Get Data Capture Plus Input configuration public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); bMain.putString("DCP", ""); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if (val == null) { if (bundle.getStringArray(key) != null) { val = ""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("DCP")) { strFinalResult += "\n"; Bundle dcpSettings = resultGetConfig.getBundle("DCP"); if (dcpSettings == null) { strFinalResult += "\nDCP Settings are not found for " + profileName; } else { strFinalResult += "\nDCP Settings"; for (String dcpKey : dcpSettings.keySet()) { strFinalResult += "\n\t\t" + dcpKey + ": " + dcpSettings.getString(dcpKey); } } strFinalResult += "\n"; } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG", "#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
MSR 入力構成の取得
// Get Magnetic Stripe Reader Input configuration public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); bConfig.putString("PLUGIN_NAME", "MSR"); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if(val == null) { if(bundle.getStringArray(key) != null) { val=""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { strFinalResult += "\nPlugin " + configBundle.getString("PLUGIN_NAME") + " Settings\n"; for (String configBundleKey : configBundle.keySet()) { if (configBundleKey.equalsIgnoreCase("PARAM_LIST")) { Bundle params = configBundle.getBundle("PARAM_LIST"); for (String paramKey : params.keySet()) { strFinalResult += "\n\t" + paramKey + ": " + params.get(paramKey); } } } strFinalResult += "\n"; } } } Log.d("TAG","#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG","#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
エンタープライズ キーボード構成の取得
public void getConfig(View view) { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "ZebraEKB"); bMain.putString("EKB", ""); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { // Reading GET_CONFIG result Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); strFinalResult = "Profile name: " + profileName; for (String key : keys) { if (key.equalsIgnoreCase("EKB")) { strFinalResult += "\n"; Bundle ekbSettings = resultGetConfig.getBundle("EKB"); if (ekbSettings == null) { strFinalResult += "\nEKB Settings are not found for " + profileName; } else { strFinalResult += "\nEKB Settings"; for (String ekbKey : ekbSettings.keySet()) { if (ekbKey.equals("ekb_layout")) { strFinalResult += "\n\t\t" + ekbKey + ": "; Bundle ekbLayoutSettings = ekbSettings.getBundle("ekb_layout"); if(ekbLayoutSettings != null){ for (String ekbLayoutKey : ekbLayoutSettings.keySet()) { strFinalResult += "\n\t\t\t" + ekbLayoutKey + ": " + ekbLayoutSettings.getString(ekbLayoutKey); } } else { strFinalResult+= "no layout defined, default will be used"; } } else { strFinalResult += "\n\t\t" + ekbKey + ": " + ekbSettings.getString(ekbKey); } } } strFinalResult += "\n"; } if (key.equalsIgnoreCase("RESULT_CODE")) { strFinalResult += "\nRESULT_CODE: " + resultGetConfig.getString("RESULT_CODE"); } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } } } };
単一インテントでの複数モジュール用の構成 (フル プロファイル) の取得
DataWedge 7.1 でサポートが開始されました。以前の DataWedge バージョンでは、複数のモジュール (プラグイン、APP_LIST、および Data Capture Plus) から情報を取得するために、複数のインテント呼び出しが必要でした。
// Get full profile configuration in a single broadcast intent and process the result @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); IntentFilter filter = new IntentFilter(); filter.addAction("com.symbol.datawedge.api.RESULT_ACTION"); filter.addCategory("android.intent.category.DEFAULT"); registerReceiver(broadcastReceiver, filter); getConfig(); } public void getConfig() { Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", "Profile007"); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { String pluginName = configBundle.getString("PLUGIN_NAME"); if (pluginName != null && pluginName.equalsIgnoreCase("ADF")) { strFinalResult += "\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " ADF Settings\n"; String pluginEnabled = configBundle.getString("adf_enabled"); strFinalResult += "\n Plugin Enabled :" + pluginEnabled; if (configBundle.containsKey("PARAM_LIST")) { Object object = configBundle.get("PARAM_LIST"); if (object != null && object instanceof ArrayList) { ArrayList<Bundle> paramArrayList = (ArrayList) object; for (Bundle rule : paramArrayList) { String name = rule.getString("name"); String enabled = rule.getString("enabled"); String priority = rule.getString("priority"); String alldevices = rule.getString("alldevices"); String string = rule.getString("string"); String stringPos = rule.getString("string_pos"); String stringLen = rule.getString("string_len"); strFinalResult += "\nRule ->"; strFinalResult += "\n name :" + name; strFinalResult += "\n enabled :" + enabled; strFinalResult += "\n priority :" + priority; strFinalResult += "\n alldevices :" + alldevices; strFinalResult += "\n string :" + string; strFinalResult += "\n stringPos :" + stringPos; strFinalResult += "\n stringLen :" + stringLen; ArrayList<Bundle> actions = rule.getParcelableArrayList("ACTIONS"); if (actions != null) { Log.d("TAG", "\n Actions->"); for (Bundle bAction : actions) { String type = bAction.getString("type"); Object param_1 = bAction.get("action_param_1"); Object param_2 = bAction.get("action_param_2"); Object param_3 = bAction.get("action_param_3"); strFinalResult += "\n type:" + type; if (param_1 != null && param_1 instanceof String) { strFinalResult += "\n param_1:" + param_1; } if (param_2 != null && param_2 instanceof String) { strFinalResult += "\n param_2:" + param_2; } if (param_3 != null && param_3 instanceof String) { strFinalResult += "\n param_3:" + param_3; } } } ArrayList<Bundle> devices = rule.getParcelableArrayList("DEVICES"); if (devices != null) { Log.d("TAG", "\n Devices->"); for (Bundle device : devices) { String type = device.getString("device_id"); Object param_1 = device.get("enabled"); Object param_2 = device.get("alldecoders"); Object param_3 = device.get("all_label_ids"); strFinalResult += "\n Device ID:" + type; if (param_1 != null && param_1 instanceof String) { strFinalResult += "\n Enabled:" + param_1; } if (param_2 != null && param_2 instanceof String) { strFinalResult += "\n All decoders:" + param_2; } if (param_3 != null && param_3 instanceof String) { strFinalResult += "\n All labelids:" + param_3; } } } ArrayList<Bundle> decoders = rule.getParcelableArrayList("DECODERS"); if (decoders != null) { strFinalResult += "\n Decoders->"; for (Bundle decoder : decoders) { String deviceID = decoder.getString("device_id"); String decoderEnabled = decoder.getString("enabled"); String decoderID = decoder.getString("decoder"); strFinalResult += "\n Device ID:" + deviceID; strFinalResult += "\n Decoder Enabled:" + decoderEnabled; strFinalResult += "\n Decoder ID:" + decoderID; } } ArrayList<Bundle> labelIDs = rule.getParcelableArrayList("LABEL_IDS"); if (labelIDs != null) { strFinalResult += "\n LabelIDs->"; for (Bundle labelID : labelIDs) { String deviceID = labelID.getString("device_id"); String lblEnabled = labelID.getString("enabled"); String lblID = labelID.getString("label_id"); strFinalResult += "\n Device ID:" + deviceID; strFinalResult += "\n Label Enabled:" + lblEnabled; strFinalResult += "\n Label ID:" + lblID; } } } } } } else if (pluginName != null && pluginName.equalsIgnoreCase("TOKEN")) { strFinalResult += "\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " TOKEN Settings\n"; Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { if (key3.equalsIgnoreCase("token_order")) { strFinalResult += "\n" + key3 + ": token_order\n"; ArrayList<Bundle> tokenOrderList = params.getParcelableArrayList("token_order"); int order = 0; for (Bundle b : tokenOrderList) { strFinalResult += "\t" + order + ". " + b.getString("name") + ": " + b.getString("enabled") + "\n"; order++; } } else { strFinalResult += "\n" + key3 + ": " + params.get(key3); } } } } strFinalResult += "\n"; } else if (pluginName != null && pluginName.equalsIgnoreCase("BDF")) { strFinalResult += "\n\nPlugin " + configBundle.getString("OUTPUT_PLUGIN_NAME") + " BDF Settings\n"; Set<String> keys2 = configBundle.keySet(); for (String key2 : keys2) { if (!key2.equalsIgnoreCase("PARAM_LIST")) { } else { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { strFinalResult += "\n" + key3 + ": " + params.get(key3); } } } strFinalResult += "\n"; } else { Set<String> keys2 = configBundle.keySet(); if (keys2.size() > 0) { if (configBundle.getString("PLUGIN_NAME") != null) strFinalResult += "\nPlugin " + configBundle.getString("PLUGIN_NAME") + " Settings\n"; for (String key2 : keys2) { if (key2.equalsIgnoreCase("PARAM_LIST")) { Bundle params = configBundle.getBundle("PARAM_LIST"); Set<String> keys3 = params.keySet(); for (String key3 : keys3) { if (key3.equalsIgnoreCase("simulscan_template_params")) { Bundle simulscan_template_params = params.getBundle("simulscan_template_params"); if (simulscan_template_params != null) { strFinalResult += "\n\tDynamic template params"; for (String template_param : simulscan_template_params.keySet()) { strFinalResult += "\n\t\t" + template_param + ": " + simulscan_template_params.get(template_param); } } } else { strFinalResult += "\n\t" + key3 + ": " + params.get(key3); } } } } } strFinalResult += "\n"; } } } else if (key.equalsIgnoreCase("APP_LIST")) { strFinalResult += "\n"; ArrayList<Bundle> appList = resultGetConfig.getParcelableArrayList("APP_LIST"); if (appList == null) { strFinalResult += "\nProfile information is not found for " + profileName; } else if (appList.size() == 0) { Log.d("TAG", "Profile " + profileName + " has no associated information"); strFinalResult += "\n" + "Profile " + profileName + " has no associated information"; } else { strFinalResult += "\nAPP LIST\n\n"; for (Bundle b1 : appList) { strFinalResult += "\n" + b1.getString("PACKAGE_NAME") + ": " + b1.getStringArrayList("ACTIVITY_LIST"); } } strFinalResult += "\n"; } else if (key.equalsIgnoreCase("DCP")) { strFinalResult += "\n"; Bundle dcpSettings = resultGetConfig.getBundle("DCP"); if (dcpSettings == null) { strFinalResult += "\nDCP Settings are not found for " + profileName; } else { strFinalResult += "\nDCP Settings"; for (String dcpKey : dcpSettings.keySet()) { strFinalResult += "\n\t\t" + dcpKey + ": " + dcpSettings.getString(dcpKey); } } strFinalResult += "\n"; } if (key.equalsIgnoreCase("RESULT_CODE")) { strFinalResult += "\nRESULT_CODE: " + resultGetConfig.getString("RESULT_CODE"); ; } } Log.d("TAG", "#IntentApp#\n\nGet config info received\n" + strFinalResult); } } } };
IP 出力の取得
// Get Internet Protocol Output public void getConfig() { Bundle bMain = new Bundle(); bMain.putString("PROFILE_NAME", "Profile007"); Bundle bConfig = new Bundle(); bConfig.putString("PLUGIN_NAME", "IP"); bMain.putBundle("PLUGIN_CONFIG", bConfig); Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_CONFIG", bMain); this.sendBroadcast(i); } private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String strFinalResult = ""; String command = intent.getStringExtra("COMMAND"); String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER"); String result = intent.getStringExtra("RESULT"); Bundle bundle = new Bundle(); String resultInfo = ""; if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) { if (intent.hasExtra("RESULT_INFO")) { bundle = intent.getBundleExtra("RESULT_INFO"); Set<String> keys = bundle.keySet(); for (String key : keys) { String val = bundle.getString(key); if(val == null) { if(bundle.getStringArray(key) != null) { val=""; for (String s : bundle.getStringArray(key)) { val += "" + s + "\n"; } } } resultInfo += key + ": " + val + "\n"; } } else if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG")) { Bundle resultGetConfig = intent.getBundleExtra("com.symbol.datawedge.api.RESULT_GET_CONFIG"); Set<String> keys = resultGetConfig.keySet(); String profileName = resultGetConfig.getString("PROFILE_NAME"); for (String key : keys) { if (key.equalsIgnoreCase("PLUGIN_CONFIG")) { ArrayList<Bundle> bundleArrayList = resultGetConfig.getParcelableArrayList("PLUGIN_CONFIG"); for (Bundle configBundle : bundleArrayList) { strFinalResult += "\nPlugin " + configBundle.getString("PLUGIN_NAME") + " Settings\n"; for (String configBundleKey : configBundle.keySet()) { if (configBundleKey.equalsIgnoreCase("PARAM_LIST")) { Bundle params = configBundle.getBundle("PARAM_LIST"); for (String paramKey : params.keySet()) { strFinalResult += "\n\t" + paramKey + ": " + params.get(paramKey); } } } strFinalResult += "\n"; } } } Log.d("TAG","#IntentApp#\n\nGet config info received\n" + strFinalResult); } if (command != null) { if (command.equalsIgnoreCase("com.symbol.datawedge.api.SET_CONFIG")) { Log.d("TAG","#IntentApp# \n\nSetConfig status received: " + result + "\nResultInfo: " + resultInfo); } } } } };
関連項目:
Zebra Support Central | インテグレータ ガイド、製品マニュアル、ソフトウェア ダウンロードおよびサポート
LaunchPad | Zebra 開発者コミュニティ
インテント | Android 開発者
インテントおよびインテント フィルタ | Android 開発者
Android インテント | チュートリアル