Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art

Sending Text Messages and Placing Calls Between AVDs

Published? true
FormatLanguage: WikiFormat

Problem:

You have made an app which needs to place or listen for calls or send or receive text messages and you want to test this.

Solution:

Fire up two AVDs and use the process id to send text messages and place calls

Discussion:

When you create an app that listens for incoming calls or text messages -- like the one in recipe Do something when the phone rings -- you can of course use the DDMS perspective in Eclipse to simulate placing calls or sending text messages, but you can also fire up another AVD!

If you look at the AVD window title you see a number before your AVD's title. This is the port number which you can use to telnet to your AVD's shell (e.g. telnet localhost 5554). Fortunately for testing purposes this number is your AVDs phone number as well. So you can use this number to place calls

... or send text.

See Also:

Do something when the phone rings