Get Android source code in M$ Windows

January 20, 2009 at 3:30 am | Posted in android | 29 Comments
Tags: ,

(Updated in 20090920)
Link to http://code.google.com/p/msysgit/

Download the Git application as below red rectangle.
git

Keep pressing next to install Git. (Very easy!!)
Execute Git by Git bash
Create a directory to get the Android source code
cd /c
mkdir android_source
cd android_source
sh autogit.sh

(Need about 5.47 GB)

autogit.sh is created by me and reference by http://android.git.kernel.org/?a=project_index
There are 163 projects in Android open source project.
If the structure of this project is modified, please tell me to modify autogit.sh.

Reference:
如何在 Windows 平台上下載 Android 的原始碼?

Create Android build code environment on Ubuntu

October 31, 2008 at 4:51 am | Posted in android | Leave a comment
Tags:

Steps:
[install essential application]
$ sudo apt-get install python2.5
$ sudo apt-get install sun-java5-jdk
$ sudo apt-get install sun-java5-bin
$ sudo apt-get install sun-java5-jre
Add/Edit /etc/bash.bashrc
export JAVA_HOME=/usr/lib/jvm/java-5-sun-1.x.x.xx (as your Java folder name)
$ sudo apt-get install flex
$ sudo apt-get install bison
$ sudo apt-get install gperf
$ sudo apt-get install libsdl-dev
$ sudo apt-get install libesd0-dev
$ sudo apt-get install libwxgtk2.6-dev
$ sudo apt-get install build-essential
$ sudo apt-get install g++
$ sudo apt-get install zip
$ sudo apt-get install curl
$ sudo apt-get install valgrind
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install libncurses5-dev

[Installing Git and Repo]
$ cd ~
$ mkdir bin

Add ~/bin to your PATH
Add/Edit /etc/bash.bashrc
export PATH=$PATH:~/bin

$ sudo apt-get install git-core gnupg

Logout and check
$ echo $PATH
$ echo $JAVA_HOME

$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Create an empty directory in ~/bin to hold your working files:
$ mkdir mydroid
$ cd mydroid

$ repo init -u git://android.git.kernel.org/platform/manifest.git
(need about 1698KB and 1 minute)

When prompted, configure Repo with your real name and email address.
If you plan to submit code, use an email address that is associated with a Google account.

A successful initialization will end with a message such as $ repo initialized in /mydroid

[Get source]
$ repo sync
(need about 1.56GB and 43 minutes)

If you meet the “error : Cannot fetch platform/external/webkit” use below command to revole it.

rm -rf .repo/projects/external/webkit.git external/webkit
cd .repo/manifests
git pull
cd ../../
repo sync

[Build code]
To build the files, run make from within your working directory:
$ cd ~/mydroid
$ make
(need about 1.85GB and 94 minutes)

[Check if success]
cd ~/bin/mydroid/out/target/product/generic/
If success, three files ramdisk.img, system.img, and userdata.img should be in this folder.

total need about 3.42GB

[Use emulator image]
copy ~/bin/mydroid/out/target/product/generic/
ramdisk.img
system.img
userdata.img
to Android SDK folder “android-sdk-windows-1.0_r1\tools\lib\images”
Start emulator.

Problems:
1. can not find by apt-get install:
   a. Reomve comments some URL in /etc/apt/sources.list ,run ‘sudo apt-get update’ to get the latest package information.
   b. If you back to proxy,setting it in /etc/apt/apt.conf
Acquire{
http::Proxy "http://[username]:[password]@proxy.com:port/";
}

 
2. Set default language to english:System -> Administration -> Language Support -> Default language -> English,reboot,系統會詢問是否將預設的資料夾由中文改成英文,選擇改成英文。

3.  If you want to share the source code, remember chmod 644 for below files:

out/target/product/generic/system.img
out/target/product/generic/userdata.img
out/target/product/generic/obj/PACKAGING/systemimage_unopt_intermediates/system.img
out/target/product/generic/obj/KEYCHARS/tuttle2.kcm_intermediates/tuttle2.kcm.bin
out/target/product/generic/obj/KEYCHARS/qwerty2.kcm_intermediates/qwerty2.kcm.bin
out/target/product/generic/obj/KEYCHARS/qwerty.kcm_intermediates/qwerty.kcm.bin
out/target/product/generic/system/usr/keychars/qwerty2.kcm.bin
out/target/product/generic/system/usr/keychars/qwerty.kcm.bin
out/target/product/generic/system/usr/keychars/tuttle2.kcm.bin

引用:
1. Build on Ubuntu 8.04
2. Get source in Android offcial website
3. How to use emulator image?

Create a free website or blog at WordPress.com.
Entries and comments feeds.