Can someone enlighten me on how to include an external java framework to android framework and compile it as a part of the custom android framework?
The idea is to make this external framework a part of my custom android framework and expose it as android service for other processes to use.
In essence what I did is -
framework/base/core/java/android/
Is this the right approach to edit Android framework? Since, I am including the java files and associated external jars of the external project inside the Android framework I suspect make fails while converting the jars to dex.
Can somebody point me towards any available resources dealing with Android Framework internals and on how to edit Android framework?
I checked the Tutorial: Android Internals - Building a Custom ROM, Pt. 2 of 2
on youtube from this year's Marko Gargenta presentation in Beijing, China. But he didn't make it (i.e. adding external framework or jars) clear either.
First: I'm not very experienced in the Android build process, so there might be a better solution, but this one should work (at least for Android 2.2).
I assume, that you use Eclipse for the source code modification and already executed a successful make -j4
...
external/<your-library>/src
<android>/frameworks/base/Android.mk
Search for # Build ext.jar
and add your library as follows:
[...]
ext_dirs := \
../../external/apache-http/src \
../../external/<your-library>/src \
../../external/gdata/src \
../../external/protobuf/src \
../../external/tagsoup/src
[...]
make -j4 ext
to build only the external module,make -j4
to build all changed files (if a previous build exists in /out/
).