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.
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
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
Xenio: you mean 8.04?
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
hi wysie.
there appears to be no issues compiling AOSP with JDK 1.6. I only use this revision to compile.
Sorry for the really late reply, till today I still get "JDK 1.5 required" when trying to compile .
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.
[email protected]:~/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
Click to expand...
Click to collapse
Sorry for my English.
Greets, Laszlo.
woo, I found this gem on a search and ended up at talk.maemo.org in the n900 section.
oracle released an armv6/armv7 headless 1.6 jre binary set! way back in april, but I hadn't seen it until today.
works in debian squeeze on my armv6 (msm7627) optimus v... it runs, but I haven't put it through its paces yet for any real testing.
I thought someone might enjoy this since for a long time it was really hard to find a jre for arm debian except for icedtea, which isn't as compatible with some things as the oracle release hopefully is.
here is the post including a download link for the jre.
another post by the same user points to an arm-friendly java7 download as well.
thank you Fabry.
official Oracle java jdk now released for ARM Linux!
download page
editbsolete.
since the sun java6 jdk is available for download to arm devices through debian apt-get, but it has a set of binaries which won't work on the armv6, someone enterprising might be able to patch the jre binaries into the jdk for a usable armv6 jdk.
/end edit
edit:
to use the 1.6 jre...
download it from Oracle
copy it to /opt in your armel debian install (or chroot)
untar it there
Code:
cd /opt
tar -xzvf ejre-1_6_0_25-fcs-b06-linux-arm-vfp-eabi-headless-14_apr_2011.tar.gz
ln -s /opt/java/ejre1.6.0_25/bin/java /usr/bin/java
thank you Dak.
after that, you should be able to use java at the command line.
further down in the first linked thread are instructions for linking the jre to fennec, probably adaptable to iceweasel.
edit:
newer JDK!
JDK 8 (with JavaFX) for ARM Early Access
for armv6 hard float applications. Installation instructions for the Raspberry Pi are linked from that page. You have to accept a license agreement.
I know this was quite a long time ago, but you state that sun-java6-jdk is in debian repositories for arm, but I am not finding it.
Is there a download link for sun-java6-jdk on arm?
Hope you see this.
Take care man. And thanks for the great info!
DiehlC said:
I know this was quite a long time ago, but you state that sun-java6-jdk is in debian repositories for arm, but I am not finding it.
Is there a download link for sun-java6-jdk on arm?
Hope you see this.
Take care man. And thanks for the great info!
Click to expand...
Click to collapse
It showed up back then when google searching for the package, but apt-get won't bring it in because of the jre dependency it can't fulfill.
they must've realized and removed it.
It may be possible to get the x86 .deb and repack it with the jre binaries or something... I actually had it installed on some chroot on my android phone to try building the android emulator on-device (which eventually worked, but the dang thing wouldn't boot in qemu.)
I'll dig around and see if I've still got it, but no guarantees.
bigsupersquid said:
It showed up back then when google searching for the package, but apt-get won't bring it in because of the jre dependency it can't fulfill.
they must've realized and removed it.
It may be possible to get the x86 .deb and repack it with the jre binaries or something... I actually had it installed on some chroot on my android phone to try building the android emulator on-device (which eventually worked, but the dang thing wouldn't boot in qemu.)
I'll dig around and see if I've still got it, but no guarantees.
Click to expand...
Click to collapse
I reolize this topic is a bit older but thought it would be worth letting you all know that installing orical's Java is way easier on Android running Linux. I've been at it awile and have a script set up to fully install the soft float version of JDK 7 and am working on a downloader script (it is actually a tall order reliably downloading the source from orical reliably) to incorperate in when debugged. Eventually I'll be testing/writing one for hard float versions too but for now you all can find what has been tested as working with "Debian Kit" from here https://github.com/S0AndS0/Debian-Kit-Mods check the readme for how to modify for your preferred version of Java and enjoy
Update 02272014- the java downloading script I mentioned earlier is now ready for testing; you may use it to download jre or jdk either hard float or soft float (4 options) and the installer script has been updated for soft float jdk version 7u51. I'll be working on making the download script call up the installer scripts today too
Update 03032014- try the "ARM_Linux_Mods" script in the above github; it will step you through the download and installation of Java JDK soft or hard float.
bigsupersquid said:
woo, I found this gem on a search and ended up at talk.maemo.org in the n900 section.
oracle released an armv6/armv7 headless 1.6 jre binary set! way back in april, but I hadn't seen it until today.
works in debian squeeze on my armv6 (msm7627) optimus v... it runs, but I haven't put it through its paces yet for any real testing.
I thought someone might enjoy this since for a long time it was really hard to find a jre for arm debian except for icedtea, which isn't as compatible with some things as the oracle release hopefully is.
here is the post including a download link for the jre.
another post by the same user points to an arm-friendly java7 download as well.
thank you Fabry.
official Oracle java jdk now released for ARM Linux!
download page
editbsolete.
since the sun java6 jdk is available for download to arm devices through debian apt-get, but it has a set of binaries which won't work on the armv6, someone enterprising might be able to patch the jre binaries into the jdk for a usable armv6 jdk.
/end edit
edit:
to use the 1.6 jre...
download it from Oracle
copy it to /opt in your armel debian install (or chroot)
untar it there
Code:
cd /opt
tar -xzvf ejre-1_6_0_25-fcs-b06-linux-arm-vfp-eabi-headless-14_apr_2011.tar.gz
ln -s /opt/java/ejre1.6.0_25/bin/java /usr/bin/java
thank you Dak.
after that, you should be able to use java at the command line.
further down in the first linked thread are instructions for linking the jre to fennec, probably adaptable to iceweasel.
edit:
newer JDK!
JDK 8 (with JavaFX) for ARM Early Access
for armv6 hard float applications. Installation instructions for the Raspberry Pi are linked from that page. You have to accept a license agreement.
Click to expand...
Click to collapse
I'm working on AOSP. I copied all extracted tar file to somewhere inside system folder. When I type
Code:
java -version
It says:
Code:
/system/bin/sh: java: No such file or directory
But it exist!
In other side, I typed
Code:
ln -s /system/ejre1.6.0_25/bin/java /usr/bin/java
and it said:
Code:
4 /system/linux_arm_sflt/jre/bin/java 4 /system/bin/java
What should I do now?
UPDATE:
When I run java directly Or symbolink), it says:
Code:
/system/bin/sh: java: can't execute: Permission denied
And when I run it with busybox, it says:
Code:
java: applet not found
UPDATE:
Even when I root my device, I get above errors.
dr_jacky_2005 said:
thank you Dak.
after that, you should be able to use java at the command line.
further down in the first linked thread are instructions for linking the jre to fennec, probably adaptable to iceweasel.
edit:
newer JDK!
JDK 8 (with JavaFX) for ARM Early Access
for armv6 hard float applications. Installation instructions for the Raspberry Pi are linked from that page. You have to accept a license agreement.
I'm working on AOSP. I copied all extracted tar file to somewhere inside system folder. When I type
It says:
But it exist!
In other side, I typed
and it said:
What should I do now?
UPDATE:
When I run java directly Or symbolink), it says:
And when I run it with busybox, it says:
UPDATE:
Even when I root my device, I get above errors.
Click to expand...
Click to collapse
you have to run Java in a Linux chroot.
Android shell can't handle it (system/bin/sh is definitely Android path)
bigsupersquid said:
you have to run Java in a Linux chroot.
Android shell can't handle it (system/bin/sh is definitely Android path)
Click to expand...
Click to collapse
What do you mean by run it in a Linux chroot?
If you means run it after type SU command, I did.
I root my device, then I can use su command in shell.
But if you means something else, please explain more in detail.
Thanks.
dr_jacky_2005 said:
What do you mean by run it in a Linux chroot?
If you means run it after type SU command, I did.
I root my device, then I can use su command in shell.
But if you means something else, please explain more in detail.
Thanks.
Click to expand...
Click to collapse
here's an example of how to use a chroot for Nexus 10
you can also look up lil debi, linuxonandroid, and variations of "chroot (debian, Ubuntu) on Android" with Google, for more information.
bigsupersquid said:
here's an example of how to use a chroot for Nexus 10
you can also look up lil debi, linuxonandroid, and variations of "chroot (debian, Ubuntu) on Android" with Google, for more information.
Click to expand...
Click to collapse
All of these installed a virtual Linux that can access with VNC!
But I want to put java binary and its libraries in my Android source, and compile it; then run my jar file with for wxampel installed terminal amulator.apk, or from PC (adb shell command).
Is that possible?
dr_jacky_2005 said:
All of these installed a virtual Linux that can access with VNC!
But I want to put java binary and its libraries in my Android source, and compile it; then run my jar file with for wxampel installed terminal amulator.apk, or from PC (adb shell command).
Is that possible?
Click to expand...
Click to collapse
probably not. the Java binary relies on Linux libraries, like libc instead of bionic. not seen anything about running Java under Android except for their dalvik java.
bigsupersquid said:
probably not. the Java binary relies on Linux libraries, like libc instead of bionic. not seen anything about running Java under Android except for their dalvik java.
Click to expand...
Click to collapse
Do you mean if I install a buildroot on my device, or pure linux from first (there is no android on my device anymore), then I can use JRE for armv7 and run a jar with GUI?
dr_jacky_2005 said:
Do you mean if I install a buildroot on my device, or pure linux from first (there is no android on my device anymore), then I can use JRE for armv7 and run a jar with GUI?
Click to expand...
Click to collapse
I've not had tons of luck getting Linux to run natively on devices, but if you can do it, yes that should work.
i like enlightenment as gui (e17) for debian on mobile device, if you're going that way.
I've developed a shell script to add custom shared java libraries into android SKD.
The purpose is to create an easy way to share new APIs using the android SDK itself, enabling developers to use some new framework feature in the same way they used to coding with a standard SKD.
A real world use case: I had to create a new feature to our cm-9 like firmware. This feature must be a brand new API inside android framework and then some applications would use it. The issue comes in how developers would compile their apps. So far the only option was every development environment point to the library source code, since android standard SKD obviously has not this new API.
Would be easier if we had a SDK with that feature, wouldn't it? Then, all developers would just use that SDK to compile their apps just as they are used to do.
This is what sdk-maker.sh intends to do.
How to use:
Code:
$ sdk-maker.sh --help
Important concepts:
Base platform: this sdk-maker will perform all operations taking an existing SDK platform as starting point. E.g., if you want to use ICS as base to your new platform, you should use android-15 since it is the folder inside
Code:
sdk_location/platforms
which refers to ICS.
API level: Same meaning used for Google. E.g.: ICS has API level 15. You must NOT have two or more platforms with the same API level. This will lead you SDK to not work with Eclipse.
Operation systems:
Linux like. Tested with Ubuntu 12.04 (LTS)
Required tools (you can both add them to your PATH or pass to sdk-maker as an argument):
dex2jar. Actually sdk-tool will look for d2j-dex2jar.sh.
zip
unzip
Limitations: It can not embed java docs. Any tips about how to do that will be appreciated.
Thanks: Unfortunately I can not post the link from where my inspiration comes because I'm a new XDA user and then I can not post outside links. I'll do that after reach 10 posts.
Hello all,
I am the noobest person when it comes to Android development, yet here I am trying to build my own Android for the Pwn Phone.
I followed the XDA guide here: http://forum.xda-developers.com/goo...opment/guide-convert-phone-pwn-phone-t2852293
As well as the official steps at Pwnie Express: https://www.pwnieexpress.com/build-pwn-phone
And after hours of reading and setting everything up according to all of the steps in those guides, I'm running into a Java error during the build portion. The two important specs are:
Linux Elementary (Ubuntu 16, Loki)
OpenJDK 6/7/8
Oracle Java 7/8
The error I'm getting is:
You asked for an OpenJDK 7 build but you version is
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java Hotspot(TM) 64-bit Server VM (build 24.80-b11, mixed mode).
I've downloaded and isntalled OpenJDK 6, 7 and 8 as well as Oracle Java 7 and 8 and I changed the defaults by running:
sudo update-alternatives --config java
sudo update-alternatives --config javac
I've changed to every version of Java listed there, removed them all and installed them all again. Either I get the above error message or I get "You are attempting to build with the incorrect version of Java...etc"
I get the error around 10 minutes after I run the "brunch hammerhead" command.
I'm not sure which version of Java I need as I believe this 1.7.0 IS Java 7. Whenever I switch to 8 it says the version is 1.8 and the same thing with 6 (1.6). I've downloaded and installed every program listed in the two guides to set up the environment properly, but somehow keep running into this problem. Would somebody out there be able to point me in the right direction? Every other command has run without a problem so I know Java is the only thing keeping me from building this ROM. This is the first ROM I've tried to compile, though I've rooted and installed many custom ROMs for previous phones. This is the first time I've been this involved in getting a ROM and any help would be appreciated.
bobisguilty said:
Hello all,
I am the noobest person when it comes to Android development, yet here I am trying to build my own Android for the Pwn Phone.
I followed the XDA guide here: http://forum.xda-developers.com/goo...opment/guide-convert-phone-pwn-phone-t2852293
As well as the official steps at Pwnie Express: https://www.pwnieexpress.com/build-pwn-phone
And after hours of reading and setting everything up according to all of the steps in those guides, I'm running into a Java error during the build portion. The two important specs are:
Linux Elementary (Ubuntu 16, Loki)
OpenJDK 6/7/8
Oracle Java 7/8
The error I'm getting is:
You asked for an OpenJDK 7 build but you version is
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java Hotspot(TM) 64-bit Server VM (build 24.80-b11, mixed mode).
I've downloaded and isntalled OpenJDK 6, 7 and 8 as well as Oracle Java 7 and 8 and I changed the defaults by running:
sudo update-alternatives --config java
sudo update-alternatives --config javac
I've changed to every version of Java listed there, removed them all and installed them all again. Either I get the above error message or I get "You are attempting to build with the incorrect version of Java...etc"
I get the error around 10 minutes after I run the "brunch hammerhead" command.
I'm not sure which version of Java I need as I believe this 1.7.0 IS Java 7. Whenever I switch to 8 it says the version is 1.8 and the same thing with 6 (1.6). I've downloaded and installed every program listed in the two guides to set up the environment properly, but somehow keep running into this problem. Would somebody out there be able to point me in the right direction? Every other command has run without a problem so I know Java is the only thing keeping me from building this ROM. This is the first ROM I've tried to compile, though I've rooted and installed many custom ROMs for previous phones. This is the first time I've been this involved in getting a ROM and any help would be appreciated.
Click to expand...
Click to collapse
hi.
any luck building the rom