使用主项目资源的Andr​​oid库主项、资源、oid、Andr

由网友(①嗰亽の菰独)分享简介:我没有得到的,这是正确的方式来解决问题或不...现状是...我创建图书馆的Andr​​oid项目。I am not getting is this is right way to solve problem or not...Situation is... I am creating Library for...

我没有得到的,这是正确的方式来解决问题或不... 现状是... 我创建图书馆的Andr​​oid项目。

I am not getting is this is right way to solve problem or not... Situation is... I am creating Library for Android project..

活动是在图书馆Project..As这将是可重复使用在不同的项目中声明。 让我们将它命名为ActivityA

Activity is declared in the Library Project..As it will be reusable in different projects. Lets Name it ActivityA

ActivityA使用这是项目的具体图像.. 我在主项目添加图片...

ActivityA is using images which are Project Specific.. I have added images in Main Project...

我没有得到如何从主项目中访问资源库中的

I am not getting how to access resources from Main project in the Library

谢谢

推荐答案

把所有相关资源的副本在库中。这是完全合法的。如果你想重写它们在实际的应用程序,你可以。如果ID发生冲突,最终产品将使用资源的应用程序。

Put a copy of all relevant resources in the library. It's perfectly legal. If you want to override them in the actual app, you can. If the IDs clash, the end product will use the resources from the app.

编辑:另一种方法是文件系统级的链接。在Windows中,使用 MKLINK 以创建硬链接到该项目中的资源文件夹;在* nix,使用 LN 。这可能搞砸你的源代码控制,如果有的话,那么谨慎行事。

the alternative is filesystem-level links. On Windows, use mklink to create hardlinks to your resource folders in the project; on *nix, use ln. This may mess up your source control, if any, so proceed with caution.

阅读全文

相关推荐

最新文章