January 27, 2021
Hot Topics:

Creating Android Libraries in Eclipse, Page 2

  • By Jessica Thornsby
  • Send Email »
  • More Articles »

Creating Android-Compliant Libraries

You have now successfully added a JAR file, but what if you wanted to create your own library, to share data across several Android projects? In this section, I'll show you how to create an Android Library from an existing Android project, and then leverage that library in a different project. After you have added the library, you will be able to use all of its classes, just as you would the standard Android SDK classes.

  1. Select the project you wish to share. Open the Project menu and select Properties.

    Eclipse Android libraries

  2. Select the Android option, and tick the Is Library box.

    Eclipse Android libraries

  3. Now you have marked this project as a library, you can easily reference it from other Android projects. Simply select a new project in Eclipse's Package Explorer and open the Properties dialog from the Project menu.
  4. Select Android from the list and click the Add button.

    Eclipse Android libraries

  5. Select the project you marked as a library, and click the Ok button.

    Eclipse Android libraries

You have now successfully added the library to your project!

Eclipse Android libraries

Originally published on https://www.developer.com.

Page 2 of 2

This article was originally published on May 9, 2012

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date