Issue
I am trying to convert an Android Studio project as a library.
What is the best way to do this and the steps I need to follow?
What file can I remove from that library project, so that the library look cleaner?
Solution
An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest. However, instead of compiling into an APK that runs on a device, an Android library compiles into an Android Archive (AAR) file that you can use as a dependency for an Android app module. Unlike JAR files, AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.
Convert an app module to a library module
Open the build.gradle file for the existing app module. At the top, you should see the following:
apply plugin: 'com.android.application'
Change the plugin assignment as shown here:
apply plugin: 'com.android.library'
Also in this file, you have to delete this line
applicationId "your.application.id"
Click Sync Project with Gradle Files.
Check this for more details https://developer.android.com/studio/projects/android-library.html
Answered By - Gopal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.