We're not half-day. After encapsulating some of the common class libraries and some custom view controls, the most convenient way to reuse them is to package the class library files.
However, I have to spit the groove Ah, the Android package is a good thing to pack everything is very troublesome, this is really not comparable with. NET, this is why I do not want to get Android.
Well, when vs2015 officially launched, when vs supports Android development, what Eclipse,android Studio these must be dead.
Open source free things just don't.
Well, that's the end of the spit.
I am using Android Studio now, after all, Google has made it clear that it will no longer support eclipse.
When exporting a class library, there are two options, one is AAR and the other is the traditional jar. The difference is that AAR contains a series of resource files for Android, and Layout,drawable are all packaged together and compared. The jar contains only the code.
So decide on the specific use of which is good as needed.
It's also easy to change, as follows:
Change a subordinate sex file, the original plugin application change to the library, and then the back of the ApplicationID commented out on the line.
This means that the project as a class library, of course, there is no applicationid such a property.
When you click build-"Makeproject, the Aar file is automatically generated.
The Arr folder
Then talk about how the other projects are imported.
In the project root node right-new-"module, here is not cut to the menu diagram ...
Choose
Select AAR file
And let Gradle run for a while.
This will be a success.
And then you want to adjust the build path
Load the referenced module
Finally remember to package into the Lib Class library project, Androidmanifest.xml file do not add any settings oh, be sure to remove the application configuration section or comment out, otherwise it may compile the time back conflict.
So that's it, you can use it directly.
Finally, spit again the IDE environment of Android, really look forward to VS2015, of course, it is best to provide native Android support, do not get an HTML framework. But it's better than the existing IDE.
and is it possible to look forward to. NET open source, perhaps can use C # Direct development Android Application ...
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Androidstudio Packaging and quoting Aar-android