In order to test the command handling, you need to send a do_command to the Android device. These commands are usually sent by web or client applications; however, Digi provides a Web Services Console within the iDigi Device Cloud Portal that can be used for testing purposes, such as this one.

The iDigi ME button located in the main-tool-bar will allow you to directly login to iDigi using your configured iDigi account:

iDigi ME

Once you are logged in to your account, navigate to the Web Services Console by selecting its tab.

Web Services Console

Before generating a web services request you need to select the device or devices you will send the command to. To do so, click the SCI Targets button. A new window is displayed.

SCI Targets - Select

Click the Add Targets drop-down menu and select your device from the list, then click the Add button.

SCI Targets - Device

Click OK to return to the Web Services Console. From the Examples menu select the SCI > Run command on device option.

Examples select

A query template will be automatically generated in the Web Services Console editor:

Template

Locate the do_command request and change the target value from cli to myTarget. To do so, replace the following line:

Host session

<do_command target="cli">


With this one:

Host session

<do_command target="myTarget">


Now set Hello from iDigi! as command data. To do so replace the following line:

Host session

<cli>who</cli>


With this one:

Host session

Hello from iDigi!


The text you have written is the data of the do_command. You can also format it (in xml, for example) to implement your own communication protocol between iDigi and the application. The code should now be similar to this:

Template - Modified

Send the query to iDigi by clicking the Send button. If you are asked for your iDigi credentials fill them in and click OK to complete the query transfer.

iDigi credentials

Now your Android device should receive the do_command displaying its data (Hello from iDigi!) in a toast message which you configured previously in the application.

do_command received

You can verify the answer sent by the Android device within the Web Services Console. On the right side of the code editor you will see a list of Web Services Responses.

Web Services Respones list

Double-click on the first response listed and you will see that the data of the do_command answer is the string you configured in the application, do_command received.

do_command answer


Clock


Star Congratulations!

You have finished the Getting Started Guide. You can learn more about the possibilities the iDigi Connector for Android offers in the next step.


Prev. Step

Home

Next Step