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

前端 未结 3 1964
感情败类
感情败类 2020-12-10 07:38

I want to convert an android project into a library project. Can this be done?

I am trying to use this project in another project.

相关标签:
3条回答
  • 2020-12-10 08:05

    S.It's possible. For eg: if you take Actionbar sherlock.

    https://github.com/JakeWharton/ActionBarSherlock/tree/master/library, it's a library

    that has been created . You can import that in properties->Android->library.

    0 讨论(0)
  • 2020-12-10 08:12

    Update for Android Studio option

    Convert an app module to a library module

    If you have an existing app module with all the code you want to reuse, you can turn it into a library module as follows:

    1. Open the build.gradle file for the existing app module. At the top, you should see the following:

      apply plugin: 'com.android.application'

    2. Change the plugin assignment as shown here:

      apply plugin: 'com.android.library'

    3. Click Sync Project with Gradle Files.

    That's it. The entire structure of the module remains the same, but it now operates as an Android library and the build will now create an AAR file instead of an APK

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


    Below steps are for Eclipse

    Steps are

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

    That's it.

    0 讨论(0)
  • 2020-12-10 08:22

    Or if you are using a Mac;

    Step One. Hold down ctrl and tap on the project. Step Two. Click Property Step Three, Android Step Four, ensure the "Is Library" check box is ticked.

    0 讨论(0)
提交回复
热议问题