Java – creating Android modular applications on eclipse

I am currently porting a framework for building Android applications on J2ME The framework consists of several projects compiled into jars Each individual jar can contain graphical data (resources, j4me screens, etc.) Each project usually has a well - defined entry point (module) When someone wants to build an application using the framework, he must only create a MIDlet project, add library dependencies and use the imported classes

We have been using the same method to develop the Android framework In this case, we only use ordinary Java projects in eclipse to compile the jar library These projects are dependent on the Android framework (Android. Jar) When building a new application, we create an Android project in eclipse and add dependencies

Our next step is to build more advanced modules for Android, which can also contain graphical information (activities, conversations, text, drawings, etc.) So far, only one Android eclipse project (final application) is needed, which contains all graphics related classes and resources It seems that the only way to use resources (text, drawing, etc.) is to create an Android application, because resources can only be referenced through integer handlers automatically created by ADT plug-in (r.xxx) As a result, building graphics modules may not be built through normal Java jar projects

The Android Developer explained that modular applications are feasible, but I didn't find a concise tutorial to explain the process, but there are some tips, such as how to prevent errors in application invokes an intent make available by other application This is valid when building applications that use other application resources I don't need to install multiple applications on the system, but I need to build from several components

Has anyone experienced the development of similar requirements? Any good tutorials or tips to start?

Solution

It seems that the only feasible way is here as shown in here

However, the solution is quite new (it only applies to the latest Android SDK. R6 and SDK 2.0. X are excluded from support) It has some important warnings. I hope Google is already working:

>There are no binary library links This means that the main application needs to access the source (in eclipse, it means opening all linked library projects). > The name of the global processing resource (layout, drawing, etc.) This means that if you have two "main. XML" layouts, only the most relevant (the top of the library list) is used. > Missing function / bug The document declares that the export activity of the library project must only be in the androidmanifest. Of the library project Declared in XML This does not work in the current version The comments in the TicTacToe example imply that this is the required work, but for the current version of Android tools, it must be in the androidmanifest. Of the main application project XML explicitly defines the activities used in the library project

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>