您可能还想考虑 Spring ME。虽然最初是用于 Java ME,但我也看到过有人将其用于 Android 的报告。这样做的好处是您拥有熟悉的编程模型 (Spring),而无需付出代价:Spring ME 的占用空间为 0k。
You might also want to consider Spring ME. Although originally intended for Java ME, I have seen reports from people using it for Android as well. The benefit would be that you have a familiar programming model (Spring) without the penalty: Spring ME has a 0k footprint.
If you are used to use Spring in other projects, you won't be very happy with Spring for Android (it's only a REST library with Auth support), Spring ME (completely different workflow and reduced featureset) or Tiny Spring (e.g. only Spring-like configuration).
You could however give my project RoboSpring a try. From the description:
RoboSpring is a (real) port of the Spring Framework to the Android platform. Additionally it offers preliminary support for functionality introduced by RoboGuice like injecting View references into Activities and more. RoboSpring is based on version 3.1.0 RELEASE of Spring's core, beans, context and aop components. It offers the following functionality:
Configure application components with a Spring configuration file (XML)
Autowire your Android components with beans from the Spring application context.
Inject the Android application context into your Spring Beans.
还有一个适用于 Android 的新 Spring 项目:Tiny Spring。它解决了 XML 配置的基础问题,但并没有完成 Spring 所做的所有事情。
There is also a new Spring project for Android: Tiny Spring. It solves the very basics of XML configuration but doesn't do everything that Spring does.
发布评论
评论(4)
您似乎可以在 Android 上使用 Google Guice 2.0。您还可以查看 roboguice。
编辑:
Spring 现在也可用于 Android
编辑:
Roboguice 现已弃用。您可以尝试 Toothpick,正如 Toothpick 背后的开发人员在评论中提到的。
It appears you can use Google Guice 2.0 with Android. You might also look into roboguice.
Edit:
Spring is also now available for Android
Edit:
Roboguice is now deprecated. You might try Toothpick as mentioned in the comments by the developer behind Toothpick.
您可能还想考虑 Spring ME。虽然最初是用于 Java ME,但我也看到过有人将其用于 Android 的报告。这样做的好处是您拥有熟悉的编程模型 (Spring),而无需付出代价:Spring ME 的占用空间为 0k。
You might also want to consider Spring ME. Although originally intended for Java ME, I have seen reports from people using it for Android as well. The benefit would be that you have a familiar programming model (Spring) without the penalty: Spring ME has a 0k footprint.
如果你习惯在其他项目中使用Spring,你不会对Spring for Android(它只是一个支持Auth的REST库)、Spring ME(完全不同的工作流程和减少的功能集)或Tiny Spring(例如仅像Spring配置)。
不过,您可以尝试一下我的项目 RoboSpring。从描述来看:
RoboSpring 是 Spring 框架到 Android 平台的(真正的)端口。此外,它还为 RoboGuice 引入的功能提供初步支持,例如将视图引用注入活动等。 RoboSpring 基于 Spring 3.1.0 RELEASE 版本的核心、bean、context 和 aop 组件。它提供以下功能:
(XML)
https://github.com/dthommes/RoboSpring
If you are used to use Spring in other projects, you won't be very happy with Spring for Android (it's only a REST library with Auth support), Spring ME (completely different workflow and reduced featureset) or Tiny Spring (e.g. only Spring-like configuration).
You could however give my project RoboSpring a try. From the description:
RoboSpring is a (real) port of the Spring Framework to the Android platform. Additionally it offers preliminary support for functionality introduced by RoboGuice like injecting View references into Activities and more. RoboSpring is based on version 3.1.0 RELEASE of Spring's core, beans, context and aop components. It offers the following functionality:
(XML)
https://github.com/dthommes/RoboSpring
还有一个适用于 Android 的新 Spring 项目:Tiny Spring。它解决了 XML 配置的基础问题,但并没有完成 Spring 所做的所有事情。
There is also a new Spring project for Android: Tiny Spring. It solves the very basics of XML configuration but doesn't do everything that Spring does.