Use of Android simulators (Introduction and creation of Android simulators)

Source: Internet
Author: User

After so long Android development, I always wanted to sum up the accumulated experience or problems in the development process, but I don't have time. Now I am idle, so I will sort out the problems I encountered in Android for my reference and hope to share them with you. If anything is wrong, please kindly advise.

The following describes how to use the android simulator.

 

 

1. Introduction to Android Simulators

Android provides a simulator to simulate mobile devices with arm cores. Android simulator is developed based on qemu, qemu is a famous open source Virtual Machine project (see http://bellard.org/qemu/), it can provide a virtual arm mobile device. The android simulator is named goldfish to simulate the arm SOC that includes the following functions:

* ARM926ej-S CPU

* Thumb support

* MMC

* Rtc

* Keyboard

* USB Gadget

* Framebuffer

* Tty driver

* NAND Flash

The source code of the android simulator is mainly in the external/qemu directory. If you want to port android to other devices, you can refer to the simulator environment you are familiar.

For application developers, simulators provide a lot of convenience for development and testing. The android simulator can run smoothly in both Windows and Linux, and Google provides the Eclipse plug-in to integrate the simulator into the Eclipse IDE environment. Of course, you can also start the android simulator from the command line.

This simulator provides complete functions, including phone book, call, and other functions (of course, you can't really call from here ). Even its built-in browsers and Google maps can be connected to the Internet. You can use the keyboard to input, click the simulator button to input, or even use the mouse to click, drag the screen to manipulate.

Of course, the simulator is a simulator after all. It is still different from the real machine,

Differences between Android simulators and real machines:

* Calls and calls are not supported. However, you can simulate calls (incoming and outgoing calls) on the console)

* USB connection not supported

* Camera/video capturing is not supported.

* Audio input (capture) is not supported, but output (replay) is supported)

* Extended headphones are not supported

* The connection status cannot be determined.

* The battery level and AC charging status cannot be determined.

* The SD card insertion/pop-up cannot be determined.

* Bluetooth is not supported.

2. Create and start an android Simulator

To play the gphone simulator, of course, you need to go to the http://developer.android.com/sdk (if you can not open the use of http://androidappdocs.appspot.com/sdk/index.html) above the download Android SDK, unzip out in the SDK root directory there is a tool folder, it contains simulators and some useful tools. (For SDK installation details, refer to the http://blog.csdn.net/magicyu2/archive/2009/11/02/4755747.aspx)

To correctly start the simulation, you must first create an AVD (Android Virtual Device virtual device)

You can use AVD to create Simulators Based on different versions. The following describes how to create AVD:

 

(1) view the currently supported versions (we need to remember the id value in the listed versions. This value is used in step 2nd ):

Magicyu @ magicyu-desktop :~ $ Android list target

You can see several available Android targets, such as: Name: Android 1.6, which have their respective idnumbers.

(2) create AVD:

Magicyu @ magicyu-desktop :~ $ Android create AVD-N magicyu-T 2

-N is followed by the name of the AVD, and-T is followed by the type of the Virtual Machine. 2 is the type ID obtained in step (1.

(3) check whether the creation is successful (if the creation is successful, the AVD information we just created will be displayed ):

Magicyu @ magicyu-desktop :~ $ Android list AVD

(4) Start the simulator:

Magicyu @ magicyu-desktop :~ $ Emulator @ magicyu or

Emulator-AVD magicyu

@ And-AVD are followed by the AVD name you created

(5) Select the start skin

Magicyu @ magicyu-desktop :~ $ Emulator-AVD magicyu-skin qvga

The skin is followed by the type of the skin to be started. All types can be found in the/platforms/Android-1. */skins directory. * indicates the version. For example, in SDK 1.6, there are several types of sdks: hvga, qvga, wvga800, and wvga854. Press Ctrl + F11 to directly change the horizontal and vertical placement of the simulator.

Of course, AVD can also be created and started in eclipse. For eclipse + ADT + SDK installation, see http://blog.csdn.net/magicyu2/archive/2009/11/02/4755747.aspx.

Run eclipse, window-> Android SDK and AVD manager to get the following interface. Select New to create an AVD.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.