How To Setup Android Development Environment

From wiki
Revision as of 08:31, 26 February 2014 by AVRman (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Building Android (operating system) for MarsBoard can be done in a variety of ways.

Here is one example of building and flashing Android on the "MarsBoard". This same method should apply to rk3066 & a10 boards.

Contents

Detailed instructions for Ubuntu 12.04 (and variants)

Introduction

In that document I will describe step by step all operations needed to build android ICS for MarsBoard using XUBUNTU 12.04-64Bit Precise Pangolin LTS. Same info are valid for all UBUNTU 12.04-64Bit distros like LUBUNTU, KUBUNTU and so on. I've also tried, with success, to use XUBUNTU 12.10-64bit so some parts are also 12.10 related.

PS: That's a document for DUMMIES / NOOBS so don't care if I was so pedant in some step description.

To keep simple my job I've installed XUBUNTU in a VMware Virtual Machine, actually in VMware Fusion with Mac OS X Lion as host computer. To work fine the virtual machine should have at least 4GB of ram and a disk of least 40GB. Also SWAP disk is important and mine was set to 2GB. More than one CPU are apprecied.

PS: I've used a virtual machine because some things on XUBUNTU evironment need to be "forced" and I would not to use

   that for my daily jobs, but you can choose to use your working machine.

So : - Get xubuntu 12.04-64Bit from xubuntu repositories and install it in a virtual machine. Remember to update it. - Install VMware Tools (if you need them - not necessary).

X - INSTALL JAVA DEVELOPMENT KIT FROM ORACLE

Install Java 1.6 JDK (recently Oracle has made this more difficult, but you can do it following these instructions:)

Get the binary here: Oracle Java 1.6


DOWNLOAD and INSTALL jdk-6u24-linux-x64.bin from oracle download page

cd ~/Downloads/
chmod +x jdk-6u24-linux-x64.bin
./jdk-6u24-linux-x64.bin 
sudo mkdir /usr/lib/jvm
sudo mv jdk1.6.0_24 /usr/lib/jvm
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_24/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_24/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_24/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo nano /etc/environment
# add this line at file tail
JAVA_HOME="/usr/lib/jvm/jdk1.6.0_24"
source /etc/environment

X - PREPARE THE ANDROID NEEDED TOOLS AND LIBS (FOR 12.04)

sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 \
   x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
     libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc \
   zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so


X - PREPARE THE ANDROID NEEDED TOOLS AND LIBS (FOR 12.10)

   sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 \
   libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 \ 
   libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \
   mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev \
   libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 \
   libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 \
   libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool \
                            libwxgtk2.8-dev python
  	sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Unfortunately ICS don't compile with gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 already installed on (*)ubuntu so we need to manually install 4.4 version with following command:

   sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

and manually change the softlink with :

      ...
Personal tools