如何将库项目如何将、项目

2023-09-04 04:56:32 作者:时光冷透少年郎i

我有一个工作的应用程序,现在希望通过向包括广告系统 mopub 。看着他们入门指南它说我应该拳头逼出库项目 (我甚至不知道那是什么)使用Git。已经做了,我现在看到,我有一个称为目录后 mopub-Android的SDK 这个目录里面有进一步的文件和子目录树。

I have a working app and now wish to include an advertising system by mopub. Looking at their getting started guide it says I should fist extract a "library project" (I'm not even sure what that is) using git. After having done that I now see that I have a directory called mopub-android-sdk inside this directory are a tree of further files and subdirectories.

导则指出,确保在Android SDK文件都在同一个父文件夹为您的项目......这是我很困惑。我有一个目录的所有我的源文件,androidmanifest等 C:\机器人\ mygame 我我现在应该把 mopub-Android的SDK 及其所有子树内的 C:\机器人?或内部 C:\机器人\ mygame ? (或别的地方?)

The guide then states "Make sure the Android SDK files are in the same parent folder as your project"... this is where I'm confused. I have all my source files, androidmanifest etc in a directory c:\android\mygame am I now supposed to put mopub-android-sdk and all its sub-tree inside c:\android? or inside c:\android\mygame? (or somewhere else?)

编辑:一些答案​​/评论讨论将库项目成一个.jar文件,然后把在我的libs目录......我不反对这个,只要的想法有人告诉我有没有缺点此相比,不使一个罐子 - 思考它更多的,不会罐子必须包括每一个单一的功能,而如果我把它作为一个库项目,编译器可能能够省略未使用code?

Some answers/comments have discussed the idea of converting the library project into a .jar file and then putting that in my libs directory... I have no objection to this so long as someone tells me there are no disadvantages to this compared to not making a jar - thinking about it more, wouldn't the jar have to include every single function, whereas if I left it as a library project, the compiler may be able to omit unused code?

编辑:现在我越来越怀疑化妆瓶,当时把合库的方法。我发现 mopub-Android的sdk.jar 斌\ RES 目录并将其复制到我的项目库目录。该广告系统似乎正常工作,但在我希望看到一个特定的图标(以关闭全屏广告)有一个垃圾图像在屏幕上的位置。我注意到,其中包括文件​​的下 mopub-Android的SDK树有一个水库包含PNG文件目录。我怀疑这些照片是不是在jar文件。

Now I am getting more sceptical about the make-jar-then-put-in-libs approach. I found mopub-android-sdk.jar in the bin\res directory and copied it to my projects libs directory. The ad system seemed to work fine, except in the location on screen where I expect to see a specific icon (to dismiss the full screen ad) there is a junk image. I noticed that amongst the tree of files beneath mopub-android-sdk there is a res directory containing png files. I suspect that these images are not in the jar file.

推荐答案

如果你只是包括的* .jar库,把它放在你的项目库/文件夹中。

If you're simply including a *.jar library, put it in the libs/ folder of your project.

如果你想有一个完整的项目...

If you're trying to include an entire project...

右键点击你想要它纳入,并转到属性的项目。在左侧,那里有标签,选择Android的。在写着图书馆preSS该区域的添加按钮,然后选择要包括该项目。做一个干净的构建你的项目。

Right click the project you want it to be included into and go to properties. On the left side where there are tabs, select "Android". In the area that says "Library" press the "Add..." button and then select the project you want to include. Do a clean build of your project.

 
精彩推荐
图片推荐