Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to include/import code to the Android Manifest?

I am working on a package for other android applications to use, and when they import the .jar, they also need to add a reasonable chunk of permissions and such to the android manifest. Is it possible to have these required permissions, intent filters and such bundled with the package, and just have them all imported into the manifest at build time with a single line in the manifest? in comparison to just providing a chunk of code to copy and paste into the manifest from the package website. I feel that this would make importing other packages (one example would be google analytics) much easier if the permissions were bundled, and something along the lines of <import package.name.manifest> was the only required line to throw in.

Any heads up as to whether this is possible would be awesome, Thanks

like image 787
Glenn.nz Avatar asked Oct 18 '11 22:10

Glenn.nz


People also ask

How many manifest file will be there in an Android application?

Your APK or Android App Bundle file can contain just one AndroidManifest. xml file, but your Android Studio project may contain several—provided by the main source set, build variants, and imported libraries.


1 Answers

Yes, it is now possible as of Revision 20 of the SDK Tools (June 2012). From the release notes:

Added automatic merging of library project manifest files into the including project's manifest. Enable this feature with the manifestmerger.enabled property.

For example usage, see Using the new "manifestmerger" property in Android.

like image 196
Graham Borland Avatar answered Oct 18 '22 23:10

Graham Borland