Reputation: 2791
Is it possible to make an entire android app a package to be included into another android app?
I am not talking about only plain java code compiled into a .jar file. I am referring as including everything: java code, layouts, etc. Then use intents to communicate to this "library". I don't want to have a separate apk or separate app installed. It is like one entire apk being included another one and make the whole thing a new app. Likely the manifest needs to be handled differently.
I looked at this tutorials but just is list a regular .jar with plain java code.
http://www.vogella.com/tutorials/AndroidLibraryProjects/article.html
any pointers greatly appreciated. thx!
Upvotes: 1
Views: 154
Reputation: 317427
You can make an .aar archive, yes. A few things to know about this:
If you are including the aar directly into the file structure of the app, you'll need to declare a dependency on it like this (or similar):
repositories {
flatDir {
dirs 'libs' // place the aar in here
}
}
dependencies {
compile(name:'fileNameOfAarWithoutExtension', ext:'aar')
}
But if you distribute the aar as a maven dependency, you can simply use the maven coordinates.
There might be other things to know, but that's what I can think of off the top of my head.
Upvotes: 1