问题
I'm not sure if its the right title but ill explain what i mean. I'm making more than one android application, but they have the same structure sliding menu , list view , about me , costume dialog with (copy,share,like) with some modifications in the styles (colors, backgrounds , fonts , menu strings )
my qustion is : is there any way to use the structure as library or implemntation or anu other way insted of coping the same codes in every projects ?
回答1:
Basically what you want to do is to create an Android library
. Just develop it like a normal application, with Activities
and layout
.
Please follow this tutorial to set up your project. http://www.vogella.com/tutorials/AndroidLibraryProjects/article.html
When you'll create a new project with the given library, all your code will be silently included and you'll get access to your Activities
and even to your R
class.
回答2:
Try Android studio - Official IDE for android development. Simple to use.
There is an option to save your project as template. Tools > Save project as template
For eclipse I think you need to write plugin https://stackoverflow.com/a/4992150/3020568
来源:https://stackoverflow.com/questions/25885452/can-i-create-an-android-application-as-template