Android学习笔记 - Android平台源代码下载以及编译

本文介绍了从零开始编译Android平台的过程,包括安装必备库、下载源码、使用repo工具管理和同步项目等步骤,并分享了作者在尝试过程中的心得与遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

I tried to analyse  source code of Android Applications, but that's really boring me.

 

I tried to write some applications for Android, but I am not familar with JAVA.

 

I tried to compile FLTK source code for Android platform, but FLTK needs a lot of other libraries. It's a little bit troublesome.

 

At last, I decide to compile whole Android platform under uBuntu, then I could analyse Android source code. I think that would be interesting.

 

 

 

Actually, I hate such huge project, it always make development deep into countless troubles.

I think that's why G-phones are not as successfull  as iphone. Hope one day this situation will change.

 

OK, Let's kick off:

 

1. Install libs

$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl li b ncurses5-dev zlib1g-dev

2. You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc. 

$ sudo apt-get install valgrind

 

 

If you don't have ubuntu, http://source.android.com/download could help you setup your system.

 

3. download the project

repo init -u git://android.git.kernel.org/platform/manifest.git

(At first, I supposed this command will download whole project files. After did that, I just found a hidden folder in my Android fold, that let me down. And I searched a lot of Chinese website, no one tells me that's why. Actually it's easy...)

4. download project files

repo sync

(Go to bed, enjoy anything you want, after that...)

 

You will find everything is done.

 

5 Build the project

Get into your working fold, just "make"

if some problems occurs, try  "export ANDROID_JAVA_HOME=$JAVA_HOME"

(Go to bed, enjoy anything you want, after that...)

 

You will find everything is mess ^_^, maybe you will find various errors according to your operation system's environment.

You should handle it by yourself. I will give you my blessing.

 

The enclosed issues maybe you would meet:

1. Can't build "assert ", just mask it.

2. JDK version. It seems jdk1.5 is supported. You can add a line in ~/.bashrc: export PATH=java_bin_path:PATH

 

 

 

As a new source code management tool, you should spend a few time to study it.

http://source.android.com/download/using-repo will give you information.

 

 




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值