我目前正在将一个用于在 J2ME 上构建应用程序的框架移植到 Android。该框架由多个编译为库(jar)的项目组成。每个单独的 JAR 都可以包含图形数据(资源、J4ME 屏幕等)。每个项目通常都有一个明确定义的入口点(模块)。当有人想要使用该框架构建应用程序时,他只需创建一个 Midlet 项目并添加库依赖项并使用导入的类。
我们一直使用相同的方法来开发 Android 框架。在本例中,我们仅使用 Eclipse 中的普通 Java 项目来编译为 jar 库。这些项目与 Android 框架 (android.jar) 具有依赖关系。构建新应用程序时,我们在 Eclipse 中创建一个 Android 项目并添加依赖项。
我们的下一步是为 Android 构建更高级的模块,这些模块还可以包含图形信息(活动、对话框、文字、可绘制对象等)。到目前为止,只需要一个 Android Eclipse 项目(最终应用程序),其中包含所有与图形相关的类和资源。似乎在使用资源(文字、可绘制对象等)时,唯一的方法是创建 Android 应用程序,因为资源只能通过 ADT 插件 (R.XXX) 自动创建的整数处理程序来引用。因此,构建图形模块可能无法通过普通的 Java jar 项目来构建。
Android开发者信息说明模块化应用程序是可行的,但我还没有找到解释该过程的简明教程,但有一些提示,例如如何防止 应用程序调用其他应用程序提供的意图。当构建使用其他应用程序资源的应用程序时,这是有效的。我不需要在系统上安装多个应用程序,而是需要由多个组件构建的应用程序。
有没有人有过类似需求的开发经验?有什么好的入门教程或技巧吗?
I am currently porting a framework for building applications on J2ME to Android. This framework consists of several projects that compile to libraries (jars). Each individual JAR can contain graphical data (resources, J4ME screens, etc.). Every project generally has a well defined entry point (module). When someone wants to build an application using the framework he must only create a Midlet project and add library dependencies and use the imported classes.
We have been using the same approach to develop the Android framework. In this case we have only used normal Java Projects inside Eclipse that compile to jar libraries. These projects have dependencies with the Android Framework (android.jar). When building a new application we create an Android Project inside Eclipse and add the dependencies.
Our next step is to build more advanced modules for Android that can also contain graphical information (Activities, Dialogs, Literals, Drawables, etc.). So far only an Android Eclipse project was needed (the end application), that contained all the graphical-related classes and resources. It seems that when using resources (literals, drawables, etc.) the only approach is to create an Android Application, since the resources are only referenceable by means of an integer handler automatically created by ADT plugin (R.XXX). So building graphical modules may not be built by means of plain Java jar projects.
Android developer information explains that modular applications are feasible, but I have not found a concise tutorial explaining the process, but some tips such as how to prevent an error to ocurr when an application invokes an intent made available by other application. This is valid when building applications that use resources from other applications. I do not need several installed applications on the system, but one built from several components.
Has anyone experience developing with similar requierements? Any good tutorial or tips to start out?
发布评论
评论(1)
似乎唯一可用的方法此处描述为暗示的通过 另一个问题的接受答案 。
然而,该解决方案相当新(它仅适用于最新的 Android SDK R6,并且不支持 SDK 2.0.X)。它有一些主要的警告,我希望 Google 已经在解决这些警告:
It seems that the only available way is described here as hinted by the accepted answer of this other question.
The solution however is rather new (it only works with latest Android SDK tooks R6 and SDKs 2.0.X are left out of support). It has some major caveats on which I hope Google is already working: