Using hidden APIs in Android (lots of illustrations)

Source: Internet
Author: User

Many APIs of the Android SDK are hidden and I can't use them directly. But we can get the complete API by compiling the source code of the Android system. After compiling the Android system source code can beout\target\common\obj\java_librariesthe directory can see all of its APIs. of course, for the general situation,out\target\common\obj\java_libraries\framework_intermediates\classes.jarIt's enough for us. If you do not yet know how to download the Android source code, please refer to theHow to download Android source (Windows and Linux)If you want to extract all of the Android APIs, please refer to theHow to get an Android class library with hidden APIswe can pass2 different waysput thisClasses.jaradd files to your Eclipse environment's Android project. Way OneFirstputClasses.jar files are copied to the Lib directory in Android project;thenIn eclipse, put the Classes.jar fileadd to the build path, as shown inFigure 1-1is shown. Figure 1-1finallyAdjust the order of Classes.jar in the Project->properties Java build path, "Order and Export" in Eclipse, so that it is before the Android SDK1-2is shown. Figure 1-2Mode twoFirstClick "Add Library ..." in "Java Build path", "Project->properties" in Eclipse, and pop Up the 2-1 dialog box.Figure 2-1Then select "User Library" in the dialog box and click on the "Next" button to enter the next step, as shown in 2-2.Figure 2-2And then in the case ofFigure 2-2In the dialog box shown, click "User Library" to enter the dialog box shown in 2-3.Figure 2-3

Then click New in the dialog box shown in 2-3 and the 2-4 dialog box appears.Figure 2-4immediatelyIn the 2-4 dialog box, enter the name of the user library (Android_debuglibs), and select "System Library (add to the Boot class path)", click "OK" button, 2-5 is shown.Figure 2-5In the dialog box shown in 2-5, select the user Library that you just created (Android_debuglibs), by clicking "Add JARS",Add our Classes.jar file to the newly createdThe User Library (Android_debuglibs), shown in 2-6.Figure 2-6And then in2-6In the dialog box shown, click "OK" and a 2-7 dialog box appears,Figure 2-7thenClick "Finish" in the dialog box shown in 2-7 and the dialog box shown in 2-8 appears.Figure 2-8and then2-8Adjust android_debuglibs in "Order and Export" in the dialog box shownorder, so that it is located before the Android SDK, such asFigure 2-9is shown. Figure 2-9 finallyClickInasFigure 2-9Click the "OK" button in the dialog shown to finish.

Using hidden APIs in Android (lots of illustrations)

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.