PHP Code:
this guide is now out of date with the relerase of the froyo source
please go to http://android.cvpcs.org for the latest update to this guide
and all future updates as well(hooray for a wiki!)
http://android.cvpcs.org/start
***PLEASE READ***
this is a guide witten by me, Sniffle, tourach23@gmail.com. It is free to be used by anyone, if you have any corrections, please make the correction to the specified section and email that SPECIFIC section to me, i will test the revision and add it to the guide as i see fir. i reserve the right not to add a submission to the guide based on it's relavence, as well as to minimize possible creation of more confusion.
***NOTICE***
this guide will no longer use any part of cyanogenmod's build setup. it will only use the motorola/sholes-open vendor setup created by koush, as it is necessary for the successful building of a rom for the Motorola Droid. at a later date(or of someone else writes them *hint hint community effort*) guides will be written to make your own personal vendor setup, as well as modify the build setup to prevent the flashing of a recovery on boot, add the superuser.apk, root, and busybox to the rom on compile. and any other goodies people want to help contribute.
***disclaimer***
i am not responsible for any damages caused(to either computer or phone) or bricked phones that may occur with the use of this guide.
downloading the source(modified by me): http://source.android.com/download
HowTo: Set up For Development in Ubuntu 9.1 (thanks denkai) - ModMyMoto - Software Modding Forums and Updates for Motorola Phones
setting up ADB and getting the system to recognize and communicate with your device(written by me):
Android SDK | Android Developers
Installing the SDK | Android Developers
MOTODEV > Log In
downloading and setting up the cyanogen vendor setup(written by me):
koush's Profile - GitHub
http://source.android.com/documentat...ding-for-dream
cyanogen's Profile - GitHub
android.git.kernel.org Git
Martin Brabham AOSP/CyanogenMod5 and the Droid
personal trial and error knowledge and PM's with koush
setting up eclipse(written by me):
http://source.android.com/using-eclipse
ADT Plugin for Eclipse | Android Developers
http://developer.android.com/resourc...ipsecomponents
running vendor setup and compiling source for droid specifically(written by me)
http://source.android.com/documentat...ding-for-dream
Martin Brabham AOSP/CyanogenMod5 and the Droid
personal trial and error knowledge and PM's with koush
i would like to say that the final breakthrough in the vendor setup was due to the inspiration of this site and it deserves a special place or its own.
Martin Brabham AOSP/CyanogenMod5 and the Droid
***************/start for ubuntu versions 9.1 and later*****************
Type
Code:
sudo gedit /etc/apt/sources.list
add to the file
Save the file and in terminal type
Code:
sudo apt-get update
sudo apt-get install sun-java5-jdk
sudo update-alternatives --config java
You may or may not need to select java5 if you already have 6 installed on that last prompt. Once that is completed remove the lines we added.
Code:
sudo gedit /etc/apt/sources.list
When the file opens delete the below lines and save.
***************/stop for ubuntu versions newer than 8.0.4*******************
********************/start downloading aosp source***************************
In terminal type
Code:
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
Install REPO and GIT. In terminal type
Code:
$ cd ~
$ mkdir bin
$ sudo gedit .profile
A text editor will pop up. put this at the bottom and save
Code:
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH**"
fi
export
In terminal type
reboot your computer
Next type
Code:
cd ~
mkdir android
cd android
mkdir system
cd system
Setup your REPO to download the source files
Code:
repo init -u git://android.git.kernel.org/platform/manifest.git
to download specific branches of code ie: eclair or erd79(android-2.1_r1) you need to add "-b eclair" to the end of the repo init
as an example for eclair branch you would type
Code:
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
You'll get "repo initialized in /"system"" if succesful. Now you need to download the source files
latest branches include:
android-2.1_r2.1s (sholes ese81)
eclair (latest eclair source available latest bleedign edge till froyo is release)
That will take awhile. Next, verify GIT tags
nothing will seem to happen, that's fine. paste this below
Code:
key 9AB10E78: "The Android Open Source Project <initial-contribution@android.com>"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu 5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEa UA6U90sEoVks0Z
wNj96SA8BL+a1O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ZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmU tkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+Bmr EOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KL M=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----
Hit CTRL+D to close and save, this will bring you back to he command prompt
now to run a generic make to make eclipse happy once we have it all set up
Code:
cd android/system
make
*************************/stop downloading the aosp source*******************
***************/start settign up SDK to run on ubuntu***********************
android SDK has ADB in it which allows you to run commands on your phone from your PC as well as many other tools.
download SDK for linux from here: http://developer.android.com/sdk/dow...5-linux_86.tgz
for the purpose of this installation we are going to install the SDK to ~/android-sdk
now back to the terminal
Code:
tar -zxvf ~/Downloads/android-sdk_r05-linux_86.tgz
mv android-sdk-linux_86 ~/android/sdk
now that everything is unzipped time to set our path to include ~/android/sdk/tools
in terminal
Code:
cd ~
sudo gedit .bashrc
in the text editor that opens paste in the following line at the bottom
Code:
export PATH=${PATH}:~/android-sdk/tools
alias sudo='sudo env PATH=$PATH'
save the file and exit
ADB is setup now to setup the computer to recognize the device
in terminal
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
in the text box that opens past int he following line
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8",SYSFS[idProduct}=="41db", MODE="0666",SYMLINK+="Motorola PCS"
*this sets up the motorola droid only*
save the file and exit
initialize ADB (this will have to be done after every reboot, updated method to be entered at a later date will remove the need for this)
Code:
sudo adb start-server
***************/stop settign up SDK to run on ubuntu***********************
*******/start generic vendor setup********
motorola directory
Code:
cd ~/android/system/vendor
mkdir motorola
cd motorola
git clone git://github.com/koush/android_vendor_motorola_sholes-open.git sholes-open
Connect your phone to your computer
in terminal
Code:
cd ~/android/system/vendor/motorola/sholes-open
. extract-files.sh
***i would suggest running the extract script once on a 2.1 rooted phone or a phone running cyanognen mod to get the latest moto proprietary files***
***depending on how many processor cores you have you can speed up the make process by appending -j(double the number of available processor cores) ie: make -j4, for a dual core processor***
*********/stop generic vendor setup***********
*************************/start settign up eclipse**************************
go to Eclipse Downloads
or click here http://www.eclipse.org/downloads/dow...nux-gtk.tar.gz
download the latest eclipse classic version(i am using 3.5.2 in this example)
once downloaded in a new terminal
Code:
cd ~
tar -zxvf ~/Downloads/eclipse-SDK-3.5.2-linux-gtk.tar.gz
mv eclipse-SDK-3.5.2-linux-gtk.tar.gz
once extracted close the terminal
right click on your desktop in an open area
click create launcher
name it whatever you want in the name area
in command click the browse button go to your eclipse directory choose the eclipse file and click open.
then click ok
you now have a desktop icon to click on
now start up eclipse
click ok for default workspace
once eclipse has started click help>install new software
click add in the top right corner
for name: galileo
location: Galileo Software Repository
click ok
click add again
name: android-sdk
location: https://dl-ssl.google.com/android/eclipse/
click ok
click the drop down box next to add. choose android-sdk.
click the box next to developer tools. then click next
***be sure that if an option to install missing components that it is checked***
sometimes other files that are needed are not available on the initial install. the galileao link should have the needed files to install SDK without problem.
eclipse after installing the SDK will restart. it will prompt you for settign up the path to your SDK and ask you if you want to provide goodle with information.
to set your android path click: window>preferences>android
browse for your SDK directory
click window>android sdk avd manager>available packages
select them all
click install selected
click bullet accept all then click install
once that's complete make should be nearing completion hopefully if not sit back and wait on make to finish. we're almost done.
once make is finished we're on the home stretch.
back in the terminal
Code:
cd ~/android/system
cp development/ide/eclipse/.classpath .
chmod u+w .classpath
modify elcipse settings to run better with android
Code:
cd ~/eclipse
gedit eclipse.ini
we're changing the memory values used by eclipse so it will function better.
in the text editor that opens
find theses values
Code:
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
and change them to
Code:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
once done save and close the file
open eclipse
click file>new>project
click java project
click create project from existing source
choose the mydroid folder
click finish
congratulations you just imported the entire android source into eclipse. next up is compiling the source itself. almost there!
*************************/stop settign up eclipse***************************
**/start running vendor setup and compiling source for droid specifically***
in terminal
Code:
cd ~
cd android/system
source build/envsetup.sh
lunch sholes-eng
make
***to make an OTA-update.zip use "make -j(?) otapackage"
(?) - remember this number is double the number of cores available on your processor
once everything is all setup it is that easy to compile for the droid.
congrats and enjoy!
***/stop running vendor setup and compiling source for droid specifically***
***************/start notes of interest and troubleshooting info ***************
***for adb to work it must be ran as root so from now on before starting work on android projects do the following***
Code:
sudo adb kill-server
sudo adb start-server
***if repo will not initialize in the correct directory this should fix it***
Code:
cd (directory of source)
rm -rf ~/.repo
repo init -u git://android.git.kernel.org/platform/manifest.git
***************/stop notes of interest and troubleshooting info ***************
**************recent sites of interest not yet used as a reference to material posted*************
Android Platform Developer's Guide | Android Open Source Android Platform Developers Guide