Proper way to update api/current.xml?

4,898 views
Skip to first unread message

David Herges

unread,
Nov 21, 2011, 7:52:00 AM11/21/11
to android-...@googlegroups.com
Hi,

I want to extend the Android API and added some classes to frameworks/base/core/java. I do

mmm frameworks/base/core/res && mmm frameworks/base/
make update-api
make sdk

Then, my custom classes are included in the framework.jar. Yet, this seems not to update api/current.xml and the classes are not included in the android.jar

I found similar problem and solution in this postings: https://groups.google.com/d/topic/android-building/Je-TX7EtDlE/discussion
However, the URL in that posting is unreachable.

What is the proper way to put custom classes into android.jar? (wihtout doing a full rebuild/clean if possible)


Thanks, David

David Herges

unread,
Nov 21, 2011, 12:25:44 PM11/21/11
to android-...@googlegroups.com
I can now add the following information: the above commands work, if the classes are placed under the 'android.*' package namespace. When classes are in another package, e.g. 'mydroid.custom', then they don't get included in android.jar (in framework.jar, they are included).

Seems like something with droiddoc so that classes are not compiled for api-stubs. I tried to edit frameworks/base/core/Android.mk and edited the following lines:

# the documentation

# ============================================================

# TODO: deal with com/google/android/googleapps

packages_to_document := \

android \

mydroid \

javax/microedition/khronos


Still this doesn't result in the api stubs being generated...


Thanks for any advise, David

Jean-Baptiste Queru

unread,
Nov 21, 2011, 12:40:16 PM11/21/11
to android-...@googlegroups.com
FWIW, the recommended way to add APIs is to add them into separate
libraries, not into the core android.jar.

I believe that device/sample has an example of that.

JBQ

> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

David Herges

unread,
Nov 22, 2011, 5:49:25 AM11/22/11
to android-...@googlegroups.com

FWIW, the recommended way to add APIs is to add them into separate
libraries, not into the core android.jar.

Yep, I know that this is the official recommendation. I do this for internal testing/playing-around only, so I'm deffo fine to modify the core Android API. 

Don't ask my why, the changes to the Android.mk seem to work now. Don't remember exactly the sequence of commands: full rebuild, make update-api, make sdk, etc., in the end, one-shot makefiles are working now.

frameworks/base/core/Android.mk

# the documentation
# ============================================================

### puts package 'mydroid' and any subpackages into API stubs (android.jar)

Reply all
Reply to author
Forward
0 new messages