Friday, April 11, 2014

Android Development Handbook


Chapter 1. Setting up Development Environment

1.1 Make sure you have installed Java Runtime  Environment (JRE) and Java Development Kit (JDK) on your machine.

1.2 Download android SDK from: http://developer.android.com/sdk/index.html, follow the instructions to set up the SDK runtime environment

1.3. For some reasons, it won't work in some OS. I was running ubuntu 12.04 LTS 64bits. I got the following error: 
"Unexpected exception 'Cannot run program "/home/.../Descargas/adt-bundle-linux-x86_64 20131030/sdk/platform-tools/adb": error=2, No existe el archivo o el directorio' while attempting to get adb version from '/home/.../Descargas/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb'"
when I launched eclipse which already integrated android SDK. I checked the error information in eclipse console, seems I need to install ia32-libs. 

One way to solve the lib dependency issue is to install the following libs one-by-one:

sudo apt-get install libgl1-mesa-dri:i386
sudo apt-get install ia32-libs-multiarch:i386
sudo apt-get install ia32-libs-multiarch
sudo apt-get install ia32-libs

It works well after all libs are ready.

1.4 Follow instructions on the Android official website and enjoy android application development.

* Sometimes, we cannot start the emulator. As I am running android studio on Ubuntu 12.04, and is using Nvidia GPU, an error may triggered because of an OpenGL library cannot be found, such as:
emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
A possible way to avoid this problem is specify the option: [ -gpu off | -no-audio ] in command line before launching the emulator.
And also, to specify the missed library path, we should add "/home/.../android-studio/sdk/tools/lib" into "LD_LIBRARY_PATH"




No comments:

Post a Comment