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

编程入门 行业动态 更新时间:2024-10-25 10:20:52
本文介绍了使用主项目资源的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库

本文发布于:2023-11-13 06:37:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583720.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:主项   资源   oid   Andr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!