Spanish Ayuda para conseguir interpretar una respuesta recibida en un intent

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
Muy buenas. Llevo varios días intentando traducir estas instrucciones a B4A, pero no termino de conseguirlo.

Según el manual de instrucciones. Para cambiar entre los posibles perfiles de escaneo definidos mediante en ScanWedge en un dispositivo Zebra hay que seguir las siguientes instrucciones:

El envío:
B4X:
// send the intent
    Intent i = new Intent();
    i.setAction(ACTION);
    i.putExtra("com.symbol.datawedge.api.CREATE_PROFILE", "Profile1");

// request and identify the result code
    i.putExtra("SEND_RESULT","true");
    i.putExtra("COMMAND_IDENTIFIER","123456789");
    this.sendBroadcast(i);

La respuesta con el resultado:
B4X:
// register to receive the result
    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 = 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: " +resultInfo + "\n" +
                      "CID:"+commandidentifier;

        Toast.makeText(context, text, Toast.LENGTH_LONG).show();

    };

Los valores de COMMAND, COMMAND_IDENTIFIER Y RESULT los consigo "obtener".
Pero el contenido que viene en RESULT_INFO soy incapaz...

El manual de instrucciones que estoy utilizando es el siguiente: http://techdocs.zebra.com/datawedge/6-7/guide/api/switchtoprofile/

Gracias y un saludo.
 
Top