Use Android x86 for Android app development.

Source: Internet
Author: User

Starting forum for Android bus. Id:android_bin

A. Required tools:

1. Virtual machine software (This article uses virtual box as an example),

2.android x86 Mirror, Http://www.android-x86.org/download, the current 4.0 and 3.2 mirrors do not support Ethernet, can only use 2.3, Recommended Android-x86-2.3-rc1-eeepc.iso.

Two. Install the Android x86 system.

Open virtual Box and create a new VM


Operating system Select Linux, version select Otherlinux




Memory 256MB can



HDD default 8GB, because it is development, 8GB more than enough




















After the virtual machine is created, you need to modify some of the configuration

First load the downloaded ISO file in:




Then is the adjustment network card, the connection method recommends chooses bridged adapter so that the virtual machine has the independent IP in the local area network to be convenient to access, then controls the chip to choose to be pcnet-fastⅲ, otherwise android-x86 cannot recognize the network card



After the virtual machine starts, you can see the following screen



The first and second projects are to let you not install experience high, medium dpi android-x86, if you are interested can run to experience the speed of x86

We want to install Android to hard drive, select last item and then enter
Installation-install android-x86 to Harddisk

Next we will enter the installation interface, the interface effect is as follows


We chose create/modify partitions to create the partition

First, we select New to create the partition.



Select Primary to create a primary partition



The partition size is the default size

Then we set the partition to boot (check bootable after carriage return), this is the partition flag will show boot,







Then we choose write to write the modification to the hard disk (select Write and then enter Yes to confirm)






After the partition is finished, select Quit to exit, and after exiting, we can see that the new partition we just allocated has been identified.



Press ENTER to select the partition, you will be asked what partition format to format the partition, it is recommended to choose EXT3



After selecting a good format, the system will confirm with you again, enter Yes to install will start

In the middle of the installation will ask you whether to install grub, here must choose Yes, since we need grub from the definition to start Android




When installing grub, you will be asked if you want to install the/system directory in read/write mode (set to read and write can be more convenient debug, but will occupy more space and installation time), select Yes



The installation will begin when you enter the car.

After the installation is complete, a menu will pop up

Three options are

Running Android
Create a virtual SD card
Restart

Because we are developing will definitely use SD card, so here we create a virtual SD card

When created will ask the size of the SD card, according to your needs to set, I set here is 512MB


The installer will start initializing the SD card after the carriage return.

After the format is complete, you will be prompted to restart,

Before restarting, you must first exit the system disk in the virtual machine CD drive.

Shut down the virtual machine first. Because you have not yet entered the Android system, you can only opt-out.

Reboot into Android system



Note that you need to set virtual box to disable automatic mouse exclusive when using the mouse in Android, or the mouse will not work properly in Android

Mouse operation method: When the mouse outside the virtual machine, click into the virtual machine, at this time is limited to use in the virtual machine, if you want to come out, click the right CTRL key to come out. Of course you can change the right CTRL key to another button in the VBox settings.


4. Connect the virtual machine using DDMS:

CTRL+F1, open the Linux Command Line window in the virtual machine. Input Netcfg

You can see the current network device status. Eth0 is the Ethernet card, now is the up state, the IP address has been assigned by DHCP, write down can

Open Eclipse, in Android-ddms, tick the use Adbhost and enter the IP address you just made.

Then switch to the Ddms tab, reset adb, you can see your virtual machine appears in the devices ~

5. Modify the virtual machine resolution to suit your development needs.

Do mobile phone development is OK, according to the above steps can begin to use, but if it is to do pad development, this resolution can not. We have to change the resolution.

First, turn off the virtual machine and turn off the VBox. These two must be turned off. Otherwise the changes below will not be saved.

Open the folder on your computer as shown in the figure. I'm using the administrator, if you use another account, watch it.

Find the folder with the name of your virtual machine. Open Android.vbox file.

After the <ExtraData> node plus the statement, how much resolution you want to add how much resolution, here is the letter x, not the * number

Note: If width > Height, the virtual machine is automatically horizontal.

After the addition, re-open the virtual machine, in the following screen press E

After entering the following screen, press E

As shown in the figure, plus vga=ask, enter

Press B again.

Now the boot will be prompted to detect multiple video mode, let you choose video mode, press ENTER

Now you can see that you add the resolution appears, you want to use which, enter the front number of the return on the line, for example, to use 1280x800, enter 360 and then return to OK.

Attention:

If you need to start the system at the resolution you specify, you need to perform the above steps on each Android virtual machine boot to modify the kernel parameters to start Android

5. Additional questions:

If you use ISO 3.2 or 4.0, the eth0 will show down when the network is set.

Enter the command line interface at this point, or use the command line software from the Application Android terminal to enter the command line

Enter SU to use an administrator account

Enter IP A to view the network card situation, there will be eth0, but the down state

Enter DHCPCD eth0 to turn on the DHCP function of the network card eth0, you will see the assigned IP address when you turn it on successfully, or you can use Netcfg view later.

Enter SetProp net.dns1 8.8.8.8 set up DNS, this 8.8.8.8 is provided by Google, you can replace the DNS on your own computer.

After setting OK, press ALT+F7 to return to the GUI, you can now surf the Internet with your browser, but the program that requires network connection is not available.

Related shortcut keys

If you do not see the mouse pointer on the Android screen, you can disable mouse integration (mouse integration) via the Virualbox menu (Host Key + I).

The "Windows key" is equivalent to the Home button of Android.

"ESC" is equivalent to the Android back button, in 2.3 of the system, the right mouse button can also be used as a return. Very convenient.

F2 equivalent to the Android Menu button

F3 equivalent to the Android Search button

ALT+F1 = Switch to console mode

ALT+F7 = switch to graphical interface mode

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.