Android Project: A detailed approach to another Android project _android

Source: Internet
Author: User

Now there's an Android project A. We wanted to extend the functionality of a, but didn't want to develop on a basis, so we created another Android project B and wanted to refer to a in B.


One idea is to make engineering a a pure jar bag so that other projects can be referenced directly.

However, if you use a reference in R.java in Project A, you cannot make a jar package. The reason is that R.java are generated automatically and are dynamic, and each compilation is not the same. If you must make a jar package, you can not use the automatically generated r file, use the resources to write code to obtain.

Another idea is to make engineering a the Android library project.

Set up Project A, right-click->properties->android, select the IS library item, and then apply. Set Project B, right key->properties->android, in the library, click the Add button, add a project, and then apply. The resources and code in A are introduced in B, and these resources and code can be invoked directly. It's important to note that because a is no longer a complete Android application, it's a class library project, so some of the content needs to be configured in B. For example, a Lib library reference, B also to join the Lib library, such as the content of the Androidmanifest.xml file in a, b in the Androidmanifest.xml file should be added ...

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.