2

I need to export a hidden class through a SDK Add-On in Android Lollipop. I'm able to export non-hidden classes. After unsuccessfully trying the "usual way" I thought the problem was due to the @hide tag. So I decided to try the "dirty" way of getting rid of the @hide keyword responsible to hide the class (even if that would obviously break compatibility with the standard API). After removing the @hide keyword and building the class with #include(BUILD_JAVA_LIBRARY) in Android.mk, the Java library Jar file is empty. So I have two questions:

  1. Why the Jar file is empty even if the DEX file includes the class?
  2. How do I achieve the same result without removing the @hide keyword?

Thank you.

Note: I have used these resources as references/documentation: http://elinux.org/images/5/5c/Build_and_Distributing_SDK_Add-Ons.pdf https://newcircle.com/s/post/1571/exploring_sdk_add_ons_for_android_devices_larry_schiefer_video

1
  • I'm not sure that the @hide keyword plays a role in what I'm trying to do...
    – Salvatore
    Commented Apr 18, 2016 at 8:03

1 Answer 1

0

I have found a solution by myself and it doesn't really involve the @hide tag. So I restored the @hide tag. The @hide tag is meaningful only when building the standard SDK. Then, I have replaced the package qualified class name, "+package_name.class_name" to export with something like "+package_name.*" into the Add-On defs file. After cleaning and rebuilding the Add-On has all the exported classes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.