简体   繁体   English

如何像mADServer一样构建自己的SDK?

[英]How to build my own SDK like mADServer?

I am looking for build my own SDK. 我正在寻找构建我自己的SDK。 I had searched a lot but I cant get clear idea about how to build my own SDK and later I need to integrate it to my project. 我搜索了很多,但我不清楚如何构建自己的SDK,后来我需要将它集成到我的项目中。 How can I build my own SDK ? 如何构建自己的SDK?

Perhaps a simple Jar would be sufficient. 也许一个简单的Jar就足够了。 You create a Jar with your classes and then your user adds that Jar to his project and so he can use your classes. 你用你的类创建一个Jar,然后你的用户将Jar添加到他的项目中,这样他就可以使用你的类了。 The AdMob SDK is done that way. AdMob SDK就是这样完成的。

You have to let your code be Library project. 你必须让你的代码成为图书馆项目。

To create a library project , set the Mark this project as library flag in the Android project generation wizard. 要创建库项目 ,请在Android项目生成向导中将“将此项目标记为库标志”。

在此输入图像描述

or if your project is already generated, you can right click in the project, and then in properties, and check the Is Library option: 或者如果您的项目已经生成,您可以右键单击项目,然后在属性中,并选中Is Library选项:

在此输入图像描述

To use such a library , in the project you want to use it right-click on it and select properties. 要使用这样的库 ,在要使用它的项目中右键单击它并选择属性。 On the Android tab add the library project to it. 在Android选项卡上添加库项目。

在此输入图像描述

Instead of this last part , you can take the generated jar of your library porject, and put it in the libs folder of your target project. 相反,这最后一部分 ,你可以把你的库,项目所产生的罐子 ,并把它放在你的目标项目的libs文件夹。

You have a complete tutorial here: http://www.vogella.com/tutorials/AndroidLibraryProjects/article.html 您有一个完整的教程: http//www.vogella.com/tutorials/AndroidLibraryProjects/article.html

(where i took the images from ) (我拍摄的图像)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM