Leave part of APP in library

2

I have an APP with a separate package for PUSH notification, I would like to take this package and turn it into Library , so in future apps I only add the Library > in my project.

How can I do this?

EDIT

IDE: Eclipse

    
asked by anonymous 17.01.2017 / 01:44

4 answers

1

With Eclipse you can create a JAR file containing classes and project information. Unlike .jar files, AAR files, possibly created using Android Studio, may contain Android features and a manifest file, which allows you to package shared features such as layouts and drawables , as well as Java classes and methods.

To create a lib You will follow the same flow to create a new project, however a flag will appear with the following message:

  

Mark this project as a lib.

See the picture:

Thenyoujustimportintoyourmainprojectasalibrary.Foraccess,right-clicktheprojectandgotoproprieties>Android.Seetheimagebelow:

Seealso create a library using Android Studio

    
18.01.2017 / 15:54
1

I do this: (assuming you know how to use github

  • In android studio, go to the build.gradle (Module: app) file and up there, change from apply plugin: 'com.android.application' to apply plugin: 'com.android.library'
  • Import the project into github within the android studio itself. Go to VCS > Import into version control > Share project on github (obviously here you will have to have an account in github and github Desktop installed on the pc)
  • Go to link and in the Git repo URL field paste the link from your repository that was created in github and then give Look up .
  • Just follow the steps (they're very simple) in the images that appear just below the jitpack website (which basically just add the lib in your normal project).
  • Ready !!
  • 17.01.2017 / 13:10
    0

    Quite easy to do ..

    First you will need to open the build.gradle of the module you want to behave like a library, and then switch apply plugin: com.android.application to apply plugin: com.android.library

    Now it will create an .AAR instead of an .APK.

    Adding a dependency is also smooth, so I advise you to read it here: link

        
    17.01.2017 / 03:10
    0

    I recently had the same need. I read a John Gabriel post and solved my problems. Follow link:

    How to create your own libraries

        
    18.01.2017 / 15:43