Saturday, June 09, 2012

Simulating an Incoming Call in the Android Simulator

At times, when developing the application or after developing the application, we are interested to test and break our application with all possible ways we can so that end users don’t end up facing such issues. One such scenario that we possibly miss out while testing our application using simulator is when a call arrives and our application is active.

This scenario is easy to simulate in the android simulator and this is done as follows:

1.       Start the Android Simulator and we can notice the number that is displayed on the title bar (as showing using the arrow mark in the screenshot below). In this case it is 5554.

2.       Open the command prompt window and type the following command to start the telnet session to localhost with port number as the number identified in the above step i.e., 5554

telnet localhost 5554

3.       This will open the telnet command session to the simulator. In this session, we can type help command and this will display all possible actions that we can perform on the simulator.

4.       From the displayed list of commands, we are interested in performing an incoming call to the simulator. The command is gsm and to know the syntax we type the following command:

help gsm

This command will display all sub-commands that can be used as part of gsm operation and they are as follows:

5.       From the above list, we are interested in the gsm call sub-command and this can be issued as follows:

gsm call 9999999999

here we can use any 10 digit number and not less or more. Issuing this command we can see an inbound call in the simulator as shown below:

                This helps us by providing a new level of testing using the android simulator and not depend on android devices in such scenarios.

                Happy Androiding…

No comments: