Using the @hide function in the SDK in eclipse

Source: Internet
Author: User

When we use Eclipse for Android development, we use the SDK provided in ADT, which contains no @hide functions and variables. Because Android for compatibility, security and other reasons, when the SDK is provided, these functions are hidden. However, many times, we need to use these functions, so we need to manually add the Android SDK. For example, when we use Audiomanager, we can call Isstreammute (int streamtype) When we need to see if some kind of streamtype is mute, but because it is @hide, we need to introduce our own SDK To compile the pass.

    1. When the ANDROID system compiles, the "include $ (build_java_library)" is compiled when the $android_source_base/out/target/common/obj/java_ Libraries generates intermediate files, which can be found when we need to use some class libraries.

      isstreammute (int streamtype) in Framework.jar, we are from Out/target/common/obj/java_libraries/framework_ Intermediates, copy the Classes.jar to local and rename it to Framework.jar.

    2. Right-click Project->properties->java Build path->libraries->add External JAR in eclipse


    3. Click order and Export to Framework.jar


    4. Now, we can use the isstreammute (int streamtype) method in Audiomanager.









Using the @hide function in the SDK in eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.