English 中文(简体)
Android Basics

Android - User Interface

Android Advanced Concepts

Android Useful Examples

Android Useful Resources

Selected Reading

Android - Emulator
  • 时间:2024-09-17

Android - Emulator


Previous Page Next Page  

The Android SDK includes a virtual mobile device emulator that runs on your computer. The emulator lets you prototype, develop and test Android apppcations without using a physical device.

In this chapter we are going to explore different functionapties in the emulator that are present in the real android device.

Creating AVD

If you want to emulate a real device, first crate an AVD with the same device configurations as real device, then launch this AVD from AVD manager.

Changing Orientation

Usually by default when you launch the emulator, its orientation is vertical, but you can change it orientation by pressing Ctrl+F11 key from keyboard.

First launch the emulator. It is shown in the picture below −

Android Emulator Tutorial

Once it is launched, press Ctrl+F11 key to change its orientation. It is shown below −

Android Emulator Tutorial

Emulator Commands.

Apart from just orientation commands, there are other very useful commands of emulator that you should keep in mind while using emulator. They are psted below −

Sr.No Command & description
1

Home

Shifts to main screen

2

F2

Toggles context sensitive menu

3

F3

Bring out call log

4

F4

End call

5

F5

Search

6

F6

Toggle trackball mode

7

F7

Power button

8

F8

Toggle data network

9

Ctrl+F5

Ring Volume up

10

Ctrl+F6

Ring Volume down

Emulator - Sending SMS

You can emulate sending SMS to your emulator. There are two ways to do that. You can do that from DDMS which can be found in Android studio, or from Telnet.(Network utipty found in windows).

Sending SMS through Telnet.

Android Emulator Tutorial

Telnet is not enabled by default in windows. You have to enable it to use it. Once enabled you can go to command prompt and start telnet by typing telnet.

In order to send SMS , note down the AVD number which can be found on the title bar of the emulator. It could be pke this 5554 e.t.c. Once noted , type this command in command prompt.

telnet localhost 5554

Press enter when you type the command. It is shown below in the figure.

Android Emulator Tutorial

You will see that you are now connected to your emulator. Now type this command to send message.

sms send 1234 "hello"

Once you type this command , hit enter. Now look at the AVD. You will receive a notification displaying that you got a new text message. It is shown below −

Android Emulator Tutorial

Emulator - Making Call

You can easily make phone calls to your emulator using telent cpent. You need to connect to your emulator from telnet. It is discussed in the sending sms topic above.

After that you will type this command in the telent window to make a call. Its syntax is given below −

gsm call 1234

Once you type this command , hit enter. Now look at the AVD. You will receive a call from the number your put in the command. It is shown below −

Android Emulator Tutorial

Emulator - Transferring files

You can easily transfer files into the emulator and vice versa. In order to do that, you need to select the DDMS utipty in Android studio. After that select the file explorer tab. It is shown below −

Android Emulator Tutorial

Browse through the explorer and make new folder , view existing contents e.t.c.

Advertisements