简体   繁体   English

如何在其他应用程序(例如Web)中使用Android R.java?

[英]How to use Android R.java in other applications (web, for example)?

The Android Resource Management is very interesting to me. Android资源管理对我来说非常有趣。 And I'm asking my self if there's a way to use it in other applications, like web, for example. 我问自己是否有办法在其他应用程序中使用它,例如Web。

I want to do this because I find it very easy to manage and to use. 我想这样做是因为我发现它非常易于管理和使用。

Is there a way to do that? 有没有办法做到这一点? To use an R.java Resources Management in other applications, not only in android? 要在其他应用程序中不仅在Android中使用R.java资源管理?

Since this is unanswered for too long, I'll compile the comments from @CommonsWare and @Rotwang. 由于答案太久了,我将编译@CommonsWare和@Rotwang的评论。

My question is not very clear. 我的问题不是很清楚。 Of course it's possible to use something close to Android Resource Management in other applications. 当然,在其他应用程序中也可以使用类似于Android资源管理的功能。 But the concept is based in the language limitations too. 但是这个概念也基于语言限制。 For example, React and React native have a completely different way to manage resources because the language has its specific behavior. 例如,React和React本机具有完全不同的资源管理方式,因为该语言具有其特定的行为。

Quoting @CommonsWare 引用@CommonsWare

Whether they are using some code-generation library to assist, I can't say, as I haven't gone looking for it. 我不能说他们是否正在使用某种代码生成库来提供帮助,因为我一直没有寻找它。 Since this code generation is performed by aapt (AFAIK), that code generation probably would be done in C/C++, as aapt is a platform-native binary. 由于此代码生成是由aapt(AFAIK)执行的,因此该代码生成可能将在C / C ++中完成,因为aapt是平台本地的二进制文件。 You might poke around the aapt source and see what you find. 您可能会在aapt来源中四处查看,然后查看发现的内容。

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

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