無効なプロファイルを無視の設定

DataWedge 15.0

SET_IGNORE_DISABLED_PROFILES

DataWedge 6.8 で導入。

DataWedge のプロファイルが、Profile0 を含め、無効なプロファイルに切り替わるのを防ぎます。DataWedge 設定パネルでの手動によるプロファイル切り替えや、SWITCH_TO_PROFILE API を使用したプログラムによるプロファイル切り替えに適用されます。

この API で制御される設定は、インテントでプロファイルを切り替える際に Android デバイスで発生することがあるタイミングの問題の対処に役立ちます。

関数プロトタイプ

Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.SET_IGNORE_DISABLED_PROFILES", "true");

パラメータ

ACTION [String]: "com.symbol.datawedge.api.ACTION"

EXTRA_DATA [String]: "com.symbol.datawedge.api.SET_IGNORE_DISABLED_PROFILES"

POSSIBLE VALUES: [String]: ["true", "false"]

戻り値

アクティブな DataWedge プロファイルの名前の文字列を返します

EXTRA NAME: "com.symbol.datawedge.api.SET_IGNORE_DISABLED_PROFILES"

EXTRA TYPE [String]: [ ]

コード例

//Sample code for sending the intent to SET the setting Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.SET_IGNORE_DISABLED_PROFILES","true"); // 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); } //receiving the results BroadcastReceiver mybroadcastReceiver = 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 Support Central | インテグレータ ガイド、製品マニュアル、ソフトウェア ダウンロードおよびサポート

LaunchPad | Zebra 開発者コミュニティ

インテント | Android 開発者

インテントおよびインテント フィルタ | Android 開発者

Android インテント | チュートリアル