简体   繁体   English

在Android上使用模块库

[英]Working with module libraries on Android

I need to create a generic application that will work with different languages (not localized per device settings) and different drawables. 我需要创建一个通用应用程序,该应用程序可以使用不同的语言(不适用于每个设备设置进行本地化)和不同的可绘制对象。 The development is done using intelliJ. 使用intelliJ完成开发。

My question is whether it is possible to create the "generic" app in a specific module, have a library modules and drawable module for the different languages/drawables. 我的问题是,是否可以在特定模块中创建“通用”应用,是否具有针对不同语言/可绘制对象的库模块和可绘制模块。 Then, I'll use different compilations (with ANT) to build the different apps (for example, english with dark style images or spanish with white style images). 然后,我将使用不同的编译器(带有ANT)来构建不同的应用程序(例如,带有深色样式图像的英语或带有白色样式图像的西班牙语)。

Thanks. 谢谢。

I'm not quite sure if this will help you, or if I understand your question but I'm currently developing an android application that dynamically loads separate modules. 我不确定这是否会帮助您,或者我是否理解您的问题,但是我目前正在开发可动态加载单独模块android应用程序。

Therefore I have my main android application that loads methods from .class files found in android jars (modules). 因此,我有主要的android应用程序,可从android jars(模块)中的.class文件加载方法。 I guess this would take care of the "generic app" part? 我想这会处理“通用应用程序”部分吗? Handling different languages - is not something I've really looked into myself, so I can't specify how to handle that. 处理不同的语言-我并不是真正地研究自己,因此我无法指定如何处理它。

Here's how my app works: 这是我的应用程序的工作方式:

Modules contain all the logic required to tell my main application how to behave -what views look like, switching between views, taking user input, connection to a server through a static library shared between my modules and my main application. 模块包含告诉我的主应用程序如何工作的所有逻辑-视图是什么样,在视图之间切换,获取用户输入,并通过模块和主应用程序之间共享的静态库连接到服务器。

Though I have found a way to dynamically load images from my modules, I am still yet to find a way to dynamically load "android layouts", so my modules pull layout files and call inflaters in order to load views, or create them from scratch pro grammatically.. 尽管我已经找到了一种从模块中动态加载图像的方法,但是我仍然没有找到一种方法来动态加载“ android布局”,因此我的模块提取布局文件并调用充气器以加载视图,或者从头开始创建它们在语法上..

My modules don't contain any "activity" classes and therefore need no generation of an Android ManifestFile. 我的模块不包含任何“活动”类,因此不需要生成Android ManifestFile。

Due to this my main application needs to have no knowledge of the number or name of "activities" to put in its android manifest file because there are none- therefore I can have as many modules as I wish - all with different functionality that the main android application has NO knowledge of. 由于这个原因,我的主应用程序不需要知道要放入其android清单文件中的“活动”的编号或名称,因为没有-因此我可以拥有任意数量的模块-所有模块都具有与主模块不同的功能android应用程序不知道。

I found your question because I was looking for a way to build my modules, quick and dirty without having to use the eclipse IDE each time to create a jar. 我找到了您的问题,因为我一直在寻找一种快速而又脏的构建模块的方法,而不必每次都使用eclipse IDE创建一个jar。 Right now my modules need to contain the following: 现在,我的模块需要包含以下内容:

.class files a .dex file generated from the .class files a customized manifest file. .class文件是从.class文件生成的.dex文件的自定义清单文件。 images required for customized views 自定义视图所需的图像

Sorry if my answer didn't really help you... 抱歉,如果我的回答没有真正帮助您...

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

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