Android 资源管理对我来说非常有趣。我问自己是否有办法在其他应用程序(例如网络)中使用它。
我想这样做是因为我发现它非常易于管理和使用。
有办法做到这一点吗?要在其他应用程序中使用R.java
资源管理,而不仅仅是在android中?
最佳答案
由于这个问题太久没有得到答复,我将整理@CommonsWare 和@Rotwang 的评论。
我的问题不是很清楚。当然,可以在其他应用程序中使用类似于 Android 资源管理的东西。但这个概念也是基于语言限制的。例如,React 和 React Native 有完全不同的资源管理方式,因为语言有其特定的行为。
引用@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. You might poke around the aapt source and see what you find.
关于java - 如何在其他应用程序(例如Web)中使用Android R.java?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27984598/