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

Search This thread

Wysie

Senior Member
Jul 4, 2009
1,122
6
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.

Introduction:
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/12/ubuntu-910-java-5-and-android-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/11/how-to-compile-android-on-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:

bmfc187

Senior Member
Feb 2, 2009
431
14
Austin, TX
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!

-BMFC
 

xenio2000

Senior Member
May 23, 2009
257
24
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.
Xenio
 

xenio2000

Senior Member
May 23, 2009
257
24
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.
Xenio
 

pershoot

Inactive Recognized Developer
Dec 1, 2008
8,077
4,426
hi wysie.

there appears to be no issues compiling AOSP with JDK 1.6. I only use this revision to compile.
 

Wysie

Senior Member
Jul 4, 2009
1,122
6
Sorry for the really late reply, till today I still get "JDK 1.5 required" when trying to compile :(.
 

pl_laszlo

Senior Member
Hello!

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
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=1.6
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=Donut
============================================
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.lang.String,boolean) in android.syncml.pim.vcard.ContactStruct cannot be applied to (java.lang.String,java.lang.String,java.lang.String,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: