Summarize the experience with Android SDK Development on Ubuntu

Source: Internet
Author: User

To test your hardware environment:

Intel VT's PC turned on (requires VT support when using KVM)

Testing the SOFTWARE Environment:

Ubuntu 12.04 x86_64

ADT Bundle Linux x86_64 (download on Android website: https://developer.android.com/sdk/index.html)

1. Download the desired image and create the AVD:

In Eclipse (ADT), "window"-> "Andorid SDK Manager" to open the SDK Manager for downloading, you need to download an SDK for the appropriate version (such as the Android 4.2.2/4.3) Platform and its corresponding arm or Intel x86 Atom System mirroring (if you want to use emulator on an Intel PC and need to use KVM acceleration, you must download the Intel x86 Atom's system mirror). In addition, because the SDK manager is the default to google.com some of the Web site to download related information, if you find that there is no connection (reason you understand), you can through the "Tools"-> "Options" set your own agent.

In Eclipse-adt, "window"-> "Andorid Virtual Device Manager" to open AVD Manager, where you can create your own AVD file, note: If you want to use KVM acceleration on the Intel platform, When you create a AVD, the Cpu/abi option is Intel Atom (x86).

In addition, if you use some programs, its definition of the API is not found, you need to download it yourself; For example, there is currently an Android API SDK, a program may require API 17, you need to download the Android 17 SDK.

2. KVM Acceleration:

As we all know, running the Android emulator is slow and sometimes too slow to endure.

If KVM is used in the Android Emulaor, the startup and Run-time programs can be accelerated, and the effect may increase the execution speed of 5~10 times; Remember to use x86 AVD.

Some command line operations are as follows:

The code is as follows Copy Code
jay@jay-linux:~$ sudo modprobe KVM
jay@jay-linux:~$ sudo modprobe Kvm_intel

jay@jay-linux:~$ Lsmod | grep KVM
Kvm_intel 137721 0
KVM 415550 1 Kvm_intel

jay@jay-linux:~$ Ps-ef | grep Emulator | Grep-v grep
Jay 11749 10704 19:48 PTS/18 00:02:18/HOME/JAY/ADT-BUNDLE-LINUX-X86_64-20130917/SDK//TOOLS/EMULATOR64-X86-AVD Android-4.2-x86-scale 0.23

jay@jay-linux:~$ Lsmod | grep KVM
Kvm_intel 137721 3
KVM 415550 1 Kvm_intel
# you can see that after using Emualtor, the Kvm_intel module already has 3 references.

3. OpenGL ES:

If you have OpenGL ES support, you can have better image processing capabilities in emulator, such as: You can run some 3D programs.

When the native is missing or ADT does not find OpenGL-related libraries, you will experience the following error.

The code is as follows Copy Code
[2013-10-10 18:34:19-APP2] Launching a new emulator with Virtual Device ' android-4.2-x86 '
[2013-10-10 18:34:26-emulator] Failed to load libgl.so
[2013-10-10 18:34:26-emulator] Error LibGL.so:cannot open shared object file:no such file or directory
[2013-10-10 18:34:26-emulator] Failed to load libgl.so
[2013-10-10 18:34:26-emulator] Error LibGL.so:cannot open shared object file:no such file or directory
[2013-10-10 18:34:26-emulator] Emulator:emulator window is out of view and is recentered

The solution is also very simple, generally have a library, just need to add a soft connection; sometimes, the library is also missing, then need to install the GL-related software library, and then establish a soft connection.

The code is as follows Copy Code
# If you can't find LIBGL related things under/usr/lib, you can use sudo apt-get install LIBGL1-MESA-GLX to install the appropriate software library.
jay@jay-linux:~$ ll/usr/lib/x86_64-linux-gnu/mesa/
Total 428
Drwxr-xr-x 2 root 4096 Sep 3 17:56./
Drwxr-xr-x root root 36864 Oct 10 15:07. /
-rw-r--r--1 root-June 04:54 ld.so.conf
lrwxrwxrwx 1 root June 04:54 libgl.so.1-> libgl.so.1.2
-rw-r--r--1 root root 390352 June 04:55 libgl.so.1.2
# can see just no libgl.so, in the/usr/lib/x86_64-linux-gnu/mesa/directory, set up a point to libgl.so.1.2 soft connection libgl.so can
# If you do not have root permissions, you can establish a soft connection in the SDK's Lib directory, as follows:
jay@jay-linux:~$ ln-s/usr/lib/x86_64-linux-gnu/mesa/libgl.so.1.2/home/jay/adt-bundle-linux-x86_64-20130917/sdk/ Tools/lib/libgl.so

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.