使用主项目资源的Andr​​oid库 [英] Android Library using Main Project Resources

查看:147
本文介绍了使用主项目资源的Andr​​oid库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有得到的,这是正确的方式来解决问题或不... 现状是... 我创建图书馆的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.

这篇关于使用主项目资源的Andr​​oid库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆