[Galaxy Note GT-N7000 General] toxicthunder:
Part 1: Setting-up Build Environment

--

​

A Build Environment is the state of the machine being used for development, including the directory structure and environment variables for your particular project.
​

Additionally, the command-line build environment for the platform and projects is your build release directory.

And so it follows that though we have our Ubuntu installations done, we are still required

to install additional packages to set-up a build environment suited for our purpose.

OpenJDK is an open-source implementation of the Java Platform, Standard Edition, and related projects.

We shall use OpenJDK-6. Type the following in your terminal -

$ sudo apt-get install openjdk-6-jdk

At the end of this step you might get a message in terminal related to the need

to update certain elements to complete installation of required packages.

For this, simply run

$ apt-get update

Python is a general-purpose, interpreted high-level programming language,

whose design philosophy emphasizes code readability.

It may already be installed on your system. But no harm in checking -

$ [B]sudo apt-get install python[/B]

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

$ [B]sudo apt-get install git-core[/B]

The Android software development kit (SDK) includes a comprehensive set of development tools.

These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.

There are 2 ways to install this.

If your Ubuntu setup is on your Home PC and you have GUI access,

you can download the package from here

http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz

To do the same via command line, type this in your terminal -

$ [B]wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz[/B]

This will download the very same package for you to the current working directory.

Now, you have to extract the folder inside the archive, and place it in your home directory.

To do this, enter the following command in your terminal -

$ [B]tar -xvzf[/B] <filename>.<extension>

For example, if your archive is named android-sdk_linux.tar.gz

where

android-sdk_linux = filename

tar.gz = extension

you will type -

$ [B]tar -xvzf android-sdk_linux.tar.gz[/B]

Once your folder is extracted, move it to your home directory. Search Google on how to do it. :)

Next step is to define the path.

For this, go to your home folder and look for a file named .bashrc

For users having the comfort of a GUI, press Ctrl + H incase the file is not visible.

Remote users can use their SCP Client to find the file easily.

Open the file to edit it, and at the bottom paste the following lines -

# Android tools

export PATH=${PATH}:~/<folder_name>/tools
export PATH=${PATH}:~/<folder_name>/platform-tools
export PATH=${PATH}:~/bin

In the same manner and place, look for the file named .profile and add the following lines at the end -

PATH="$HOME/<folder_name>/tools:$HOME/<folder_name>/platform-tools:$PATH"

Once, done you now have the Android SDK successfully installed. :good:

In the end, you have to install the remaining packages and libraries and dependencies and what not.

This varies as per the version of the Ubuntu installation.

Since we are (hopefully) on Ubuntu 12.04 (64-bit) , we need to enter the following command in our terminal -

$ $ s[B]udo apt-get install git-core 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 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386[/B]

and then

$ [B]sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so[/B]

In the even that you get errors relating to unavailability of g++ and gcc

run the following in terminal -

$ [B]apt-get install gcc[/B]

$ [B]apt-get install g++[/B]

and then repeat the previous steps.

I would also advise that you install the following as well (more on it later) -

$ [B]apt-get install lzma[/B]

$ [B]apt-get install screen[/B]

With the above done, all that is left to do is to initialize the repository that you require and then sync it to your machine or remote server. This we do in the next part.

--