How to setup Android into Ubuntu 10.04?
Recently I tried to set up Android which is the uprising mobile operating system with the lastest version of Ubuntu. And I faced some difficulties because the documentation in Google's Android site was a little bit passe. So now, I want to share the information how to get the source and build on the Ubuntu 10.04 LTS environment step-by-step.
To build the system, you should get the libraries required. And Android site suggests the following command to install all of them.
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
Everything would be okay except.. sun-java5-jdk. The package is deprecated and is now unavailable. Then what can we do instead? Open JDK is the answer. You can do the following to get it.
$ sudo apt-get install openjdk-6-jdk ant
$ sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
You may notice that the version of Java is 6 and Google warns that Java 6 is not supported in Android because of incompatibilities with @Override. However, there's no problem to get the source and build the system. Before getting the code, you need to set for repo.
$ sudo curl http://android.git.kernel.org/repo -o /usr/local/bin/repo
$ chmod a+x ~/usr/local/bin/repo
You're set the environment and now is the time to get the source. Go to the location where you want to get the whole source and give the commands.
$ repo init -u git://android.git.kernel.org/platform/manifest.git
$ repo sync
If you encounter the message "command not found" then you can do it with the following commands:
$ sudo sh /usr/local/bin/repo init -u git://android.git.kernel.org/platform/manifest.git
$ sudo sh /usr/local/bin/repo sync
It will take much time to get the code even though the line is fast as the project itself is really huge. After the long waiting, you will find that the checkout process has been ended. The next thing to do is MAKE to build the project. But you will meet a message that the Java version is not correct and the build process fails. Then you can modify the build/core/main.mk file to change the text "1.5" to "1.6".
One more thing to do. Ubuntu 10.04 has tweaked a little and you should install additional features like the follow:
$ sudo apt-get install gcc-multilib g++-multilib
This is the finally stage. You can build it clearly with MAKE command. But remember that it may cost a lot of time even more than to get source codes. Anyway, I succeeded to do all these kinds!