Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,803,273 Members 44,816 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Wysie
Old
(Last edited by Wysie; 29th April 2010 at 03:33 AM.)
#1  
Senior Member - OP
Thanks Meter 6
Posts: 1,119
Join Date: Jul 2009
Default [HOW-TO] Compiling System Apps (Contacts, Mms, Browser, etc.)

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...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.
 
bmfc187
Old
#2  
bmfc187's Avatar
Senior Member
Thanks Meter 2
Posts: 406
Join Date: Feb 2009
Location: 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
Sprint Samsung Transform Ultra SPH-M930
ROM: Stock for now, Custom In The Works!
 
xenio2000
Old
#3  
xenio2000's Avatar
Senior Member
Thanks Meter 22
Posts: 256
Join Date: May 2009
Location: Sassari
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
 
Wysie
Old
#4  
Senior Member - OP
Thanks Meter 6
Posts: 1,119
Join Date: Jul 2009
Xenio: you mean 8.04?
 
xenio2000
Old
#5  
xenio2000's Avatar
Senior Member
Thanks Meter 22
Posts: 256
Join Date: May 2009
Location: Sassari
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
Old
#6  
Recognized Developer
Thanks Meter 3,851
Posts: 7,714
Join Date: Dec 2008
hi wysie.

there appears to be no issues compiling AOSP with JDK 1.6. I only use this revision to compile.
 
Wysie
Old
#7  
Senior Member - OP
Thanks Meter 6
Posts: 1,119
Join Date: Jul 2009
Sorry for the really late reply, till today I still get "JDK 1.5 required" when trying to compile .
 
pl_laszlo
Old
(Last edited by pl_laszlo; 29th March 2010 at 07:52 PM.)
#8  
Senior Member
Thanks Meter 100
Posts: 118
Join Date: Jan 2009
Location: N: 54 0' 58" E: 20 2' 25"

 
DONATE TO ME
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.

Quote:
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.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.
Blog
Flickr
Twitter: pl_laszlo
----
My productions: Donut by Laszlo, eClair by Laszlo, Froyo by Laszlo - if you like them, please donate and motivate me to more work !

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes