S-View Clocks for Note 4

Do you want a classy clock for your classy S-View cover? XDA Recognized Themersibinnhas provided us very … more

1% Battery Mod Themes for M8 Lollipop

If you have the battery-themer mod “1% battery”, this collection fromXDA Recognized Themer … more

No Timeline for Wi-Fi Direct Vulnerability , Says Google

CoreSecurity and Google have an ongoing dispute over the nature of a Wi-Fi Direct … more

Android Is the First Mobile OS to Ship 1 Billion Devices In a Year

Another milestone for Android! According to Strategy Analytics’ … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[HOW-TO] Compiling System Apps (Contacts, Mms, Browser, etc.)

OP Wysie

24th December 2009, 03:51 AM   |  #1  
OP Senior Member
Thanks Meter: 6
1,119 posts
Join Date:Joined: Jul 2009
Hi all, before I begin, this is NOT meant to be a complete guide, but rather, just help to point in the right direction for those who want to compile/mod some of the system apps, but are a little lost. I was like this myself, and searched all over the place before putting bits and pieces together. Thanks goes out to xenio2000 and cytown for some of their advice.

To compile system apps such as Mms.apk, Contacts.apk, etc. you need the entire Android source. Also, you have to be running either Linux or OS X (with case-sensitive file system). Personally I dual boot Ubuntu 9.10 for it, so this instructions will be based on Ubuntu 9.10.

Step 1: Get Android Sources
To get the Android sources, follow the Linux instructions here: http://source.android.com/download

Remember you have to specify "-b donut" at the end of your repo command if you want to get the Donut base. Otherwise you will get master which is a mix of Eclair already .

Step 2: Get Java 5
If you are running Ubuntu 9.10, you will need to install Java 5 as you cannot compile AOSP on Java 6. I followed the instructions here: http://androidenea.blogspot.com/2009...roid-open.html, and used Method 1. However, I downloaded Java 5 update 22 here: http://java.sun.com/javase/downloads/5u22/jdk (the one linked in the post is update 21).

The reason I use method 1 over method 2 is that this way, I only export the path when I want to compile (and it's only within the environment), while my browsers like Firefox, etc. are still running the latest Java 6.

Step 3: gcc
Lastly, I remember having some issues compiling due to gcc. I followed the guide here: http://www.mobileadvice.com.au/2009/...n-ubuntu-9-10/

Step 4: Compiling
Once all is done, you can "cd" to the root directory of your Android source, and type "make Contacts" or "make Mms". The first compilation will be a little long. I know of some people who do "make", that is they compile the entire source the first time, before using "mmm Phone". I don't recommend that because doing a "make" without any parameters will result in compilation of many apps you don't need, or want, and it's very slow.

Also, to "replace" the AOSP Contacts with let's say my Contacts, just "cd" to your root directory of Android, and type "git clone git://github.com/Wysie/android_packages_apps_Contacts.git". You can then play with my code but can't push back (need to know more git stuff for that). I suggest you fork the repos you are interested in, so you can push and make direct changes. Sorry I can't advice much on that, as I use git as though it's svn :X. I'm a git noob.

Hope it helps . As I said earlier, this is just to give you guys a rough idea of what's needed. In fact, I copied and paste my reply to someone else into here.
Last edited by Wysie; 29th April 2010 at 04:33 AM.
24th December 2009, 04:00 AM   |  #2  
bmfc187's Avatar
Senior Member
Flag Austin, TX
Thanks Meter: 8
419 posts
Join Date:Joined: Feb 2009
This will prove to be helpful, im sure. right now i dont have my Android environment setup, i had some problems upgrading to Karmic, and so i wiped my linux partition and started over with a fresh install. So far ive been too lazy to set it all up again, but already you've answered some questions i had, thanks!

24th December 2009, 11:33 AM   |  #3  
xenio2000's Avatar
Senior Member
Flag Sassari
Thanks Meter: 22
256 posts
Join Date:Joined: May 2009
Just a little suggestion:
If you use Ubuntu just to work on Android Source and nothing else, install Ubuntu 9.04 you will have less headache on compile and you can skip step 2 and 3 on Wysie guide.
24th December 2009, 01:14 PM   |  #4  
OP Senior Member
Thanks Meter: 6
1,119 posts
Join Date:Joined: Jul 2009
Xenio: you mean 8.04?
24th December 2009, 02:30 PM   |  #5  
xenio2000's Avatar
Senior Member
Flag Sassari
Thanks Meter: 22
256 posts
Join Date:Joined: May 2009
Ubuntu 8.04 is what Google suggest, I am using 9.04 and it is ok
With the 9.10 I have got a lot of problem with compile and java5/6
Probably with your tips is ok Ubuntu 9.10 but I use w7 for every day works
And I use Linux only for android source.
24th December 2009, 05:16 PM   |  #6  
Recognized Developer
Thanks Meter: 3,982
7,788 posts
Join Date:Joined: Dec 2008
hi wysie.

there appears to be no issues compiling AOSP with JDK 1.6. I only use this revision to compile.
2nd March 2010, 05:15 PM   |  #7  
OP Senior Member
Thanks Meter: 6
1,119 posts
Join Date:Joined: Jul 2009
Sorry for the really late reply, till today I still get "JDK 1.5 required" when trying to compile .
29th March 2010, 06:38 PM   |  #8  
Senior Member
Flag N: 54 0' 58" E: 20 2' 25"
Thanks Meter: 100
118 posts
Join Date:Joined: Jan 2009
Donate to Me

I tried to compile Mms from rgv151 - nothing changed, just for fun = I received 'Error 41'.
if i try to compile stock mms from source it will work.


laszlo@laszlo-NoteBook:~/mydroid$ make Mms
build/core/copy_headers.mk:15: uwaga: polecenia zakrywające dla obiektu `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: uwaga: ignoruję stare polecenia dla obiektu `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
Install: out/host/linux-x86/bin/aapt
Copying out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar
Install: out/host/linux-x86/framework/dx.jar
Install: out/host/linux-x86/bin/dx
target Prebuilt: libgoogleclient (out/target/common/obj/JAVA_LIBRARIES/libgoogleclient_intermediates/javalib.jar)
Copying out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes-full-debug.jar
Install: out/host/linux-x86/bin/aidl
Copying out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar
target Java: Mms (out/target/common/obj/APPS/Mms_intermediates/classes)
android_packages_apps_Mms/src/com/android/mms/activity/VCardManager.java:304: incompatible types
found : java.lang.String
required: java.util.List<java.lang.String>
contactStruct.notes = contactC.getString(
android_packages_apps_Mms/src/com/android/mms/activity/VCardManager.java:358: addContactmethod(int,int,java.lang.String,java.lan g.String,boolean) in android.syncml.pim.vcard.ContactStruct cannot be applied to (java.lang.String,java.lang.String,java.lang.Strin g,java.lang.String)
contactStruct.addContactmethod(kind, data, type, label);
android_packages_apps_Mms/src/com/android/mms/transaction/SmsReceiverService.java:240: incompatible types
found : android.telephony.SmsMessage[]
required: android.telephony.gsm.SmsMessage[]
SmsMessage[] msgs = Intents.getMessagesFromIntent(intent);
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
make: *** [out/target/common/obj/APPS/Mms_intermediates/classes-full-debug.jar] Błąd 41

Sorry for my English.

Greets, Laszlo.
Last edited by pl_laszlo; 29th March 2010 at 08:52 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes