Android: About master Engineering and library project

Source: Internet
Author: User

1, how to use an Android project as Library project Libraries Project is used as a jar package by other Android projects, first it is also a normal Android project. Then:1in Eclipse package Explorer, right-click Android Project to select Properties2Select Android, drop-down scroll bar to the bottom, select ' Is Library '3Click Apply, click OK this Android project has become the library project. Note: As a library project can refer to the external jar package, but can not reference other library projects, in the library project cannot use the Aidl file, cannot reference raw, assets under the resources in addition when attempting to run a library project, Eclipse will error:2, the main project how to cite the library project after the reference to the LIB project, the main project can call the library project related classes and methods. Android Project references other library engineering steps:1in Package Explorer, right-click Android Project to select Properties2Select Android, drop down to the right of the scroll bar to the bottom3Click the Add button to open the Lib Project selection dialog box4Select the project from the selection dialog box and click OK5Click the Apply button and click the OK button3, in the main project Manifest.xml file, declare the LIB engineering components of the main project Manifest.xml must add all activity, Service, receiver, provider of the library project, Also add the library project permission, uses-Library and other attributes, note the referenced component to use the full package name, otherwise the corresponding notfoundexception will be reported. 4, the conflict between library engineering and main engineering resources when running an Android project referencing the library project, the Android tool will merge all the resources of the Library project with the master project. If a resource ID is likely to be defined between the library project or between the Library project and the master project, the resource ID with high priority will override the lower priority, and resources will be used with the most wired-level project. How the priority level between projects is determined, see the next article. 5, library Engineering, and the priority of resource use in the main project show that an Android project cites four library projects, which have priority points between the four library projects and the main project. Android master project has the highest priority, the four library engineering imperial Examinations ranked down to the next priority level. Library projects can also be manually sorted, select one, click Up (Increase priority) or down (lower priority). 6, library Engineering, and master engineering use different Android platform version problems when the main project is packaged, the Android SDK version uses the main project. So the Android SDK version used by the library project is either higher than the main project SDK version. If the Library Engineering SDK version is higher than the main project, it will not compile. 

Android: About master Engineering and library project

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.