How to convert an android project to a library project in Eclipse?

I want to convert an android project to a library project. It can be done?

I am trying to use this project in another project.

+4
source share
3 answers

Update for Android Studio

Convert application module to library module

If you have an existing application module with all the code that you want to reuse, you can include it in the library module as follows:

  • Open the build.gradle file for an existing application module. At the top you will see the following:

     apply plugin: 'com.android.application' 
  • Change the purpose of the plugin as shown below:

     apply plugin: 'com.android.library' 
  • Click Sync Project with Gradle Files .

What is it. The whole structure of the module remains the same, but now it works like an Android library, and the assembly will now create an AAR file instead of the APK

Read more about Create an Android library and how to Convert an existing project to a library project in Android Studio


Following are the steps for Eclipse

Steps

 Right click on project -> property -> Android -> check 'Is library' check box -> OK 

What is it.

+7
source

S. It is possible. For example: if you use Actionbar sherlock.

https://github.com/JakeWharton/ActionBarSherlock/tree/master/library , this is a library

which was created. You can import this in properties -> Android-> library.

+1
source

Or if you are using a Mac,

Step one. Hold Ctrl and click on the project. Step Two Click "Properties" Step Three, Android Step Four, make sure the "Is the library" checkbox is selected.

0
source

All Articles