roboguice

Maven, ActionBarSherlock v4 and Roboguice v2 - How do I get it to build?

风流意气都作罢 提交于 2019-12-24 02:03:01
问题 I'm trying to build a project to uses both ActionBarSherlock v4 and Roboguice v2 (I like beeing of the bleeding edge :) ). The problem is that ABS uses a slightly modified compatibility library, that Roboguice needs. I got it working fine under Eclipse by adding actionbarsherlock-plugin-compat-lib-4.0.0-SNAPSHOT , roboguice-2.0b3 and the ActionBarSherlock project. Now the problem is that under Maven, I need to include the following dependency because of Roboguice: <dependency> <groupId

How can I inject parameter through constructor in Roboguice? [android]

狂风中的少年 提交于 2019-12-22 10:15:38
问题 This question is probably exact duplicate of this one Pass parameter to constructor with Guice Difference is that I use roboguice for android, not just Guice, so answers there does not work for me. Question is - how can I pass initialize parameters into created object? I.e. I have injected interface which should be initialize with some parameter which roboguice does not know. What I see in link I provide, I should create factory interface and register it like this void configure(Binder binder

java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class at the start of android app

冷暖自知 提交于 2019-12-21 07:29:24
问题 I'm developing and android countdown app. In the app you can add or delete as many countdowns as you want. All the Countdowns are saved in an ArrayList. I can't just save them in an database or in the shared preferences because the countdown have to keep running even if you leave the app. I'm using roboguice 2.0 and guice-3.0-no_aop.jar to handle my dependency Injections. Most of the times everthing works fine but sometimes if i start the app i only get the following warning and all the

java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class at the start of android app

核能气质少年 提交于 2019-12-21 07:29:06
问题 I'm developing and android countdown app. In the app you can add or delete as many countdowns as you want. All the Countdowns are saved in an ArrayList. I can't just save them in an database or in the shared preferences because the countdown have to keep running even if you leave the app. I'm using roboguice 2.0 and guice-3.0-no_aop.jar to handle my dependency Injections. Most of the times everthing works fine but sometimes if i start the app i only get the following warning and all the

Keep annotated class in Proguard

一个人想着一个人 提交于 2019-12-20 10:34:10
问题 I have a bunch of classes that use e.g. an @Singleton annotation like so @Singleton public class ImageCache that I would like to keep. How can I configure a proguard -keep statement so it applies to all classes that have that annotation. Btw in terms of context I need this for an app using Roboguice on Android, which is why I added the tags. Might help others. 回答1: ProGuard is based on a java-like configuration with wild-cards. It does require fully qualified class names. This should work:

Process crashes during creation of RoboGuice injector, if there is a mocked instance in any module

落爺英雄遲暮 提交于 2019-12-20 09:31:57
问题 I have a problem with using RoboGuice and AndroidMock frameworks in unit testing. I've created a simple project to show my problem. Here I create a mocked instance and register it in the RoboGuice. But the process crashes between the "setUp()" and "test01()" methods. As I guess, actually the process crashes when the Injector is created, if any module has a mocked instance inside. If I replace the mocked instance with an instance of a class that implements the interface then everything works

Injected objects became null after upgrading to Roboguice 3

大城市里の小女人 提交于 2019-12-19 19:52:53
问题 I've just upgraded our project to use Roboguice 3 and all of a sudden all the injected objects became null, that includes POJO, Providers, Views, Resources etc. And I'm struggling to figure out why. First of all there's the gradle build file, tried both Proguard on and off and it didn't make a difference. I believe we are currently using Roboguice 3.0.1, but I tried 3.0 and still had the problem. compile ('org.roboguice:roboguice:3.+') { exclude module: 'asm' } provided 'org.roboguice

roboguice how to inject custom class

这一生的挚爱 提交于 2019-12-18 16:56:44
问题 hi i am currently using roboguice as we know, we can use annotation to get class injected such as @InjectView(R.id.list)ListView x the @inject notation works, because i extend from RoboActivity, or any Robo class my question is if i want to inject a custom class, called public class CustomUtilManager { } i want to be able to Inject it in say RoboActivity @Inject CustomUtilMananger how do i do it? my second question is, if i have a class, that is not subclass of any Robo* class say public

What are the specific benefits of using DI on Android?

女生的网名这么多〃 提交于 2019-12-17 18:17:09
问题 What are the specific benefits or advantages of using a dependency injection framework for Android, like Dagger, Transfuse or RoboGuice? For example, what kind of apps would benefit the most from using DI? is there more of a performance advantage, or is it more on the ease of extending an app, or even more about making it testable? One of the reasons for asking this is to gauge if an app I'm developing would actually benefit from it or not much. Since I intend the app to be serious at some

外部JAR上的“到Dalvik格式的转换失败,错误1”

别等时光非礼了梦想. 提交于 2019-12-15 20:54:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在Eclipse中的Android应用程序中,出现以下错误。 超出预期的最高级别: java.lang.IllegalArgumentException:已添加:Lorg / xmlpull / v1 / XmlPullParser; .... 转换为Dalvik格式失败,错误1 仅当我向项目中添加特定的外部JAR文件时,才会出现此错误。 我搜索了很长时间以寻找可能的解决方案,但是所有可能的解决方案都无效。 我什至尝试更改为Android 1.6而不是1.5(我使用的当前版本)。 #1楼 我发现了其他东西。 Android使用 /libs 目录存储JAR文件。 我无数次看到“向Dalvik格式转换失败并出现错误1”错误,总是在我的JAR文件中出现错误时出现。 现在,通过将新的JAR文件放在 /libs 目录中,并将类路径切换到新版本,我将Roboguice升级到了新版本。 这导致了Dalvik错误。 当我从 /libs 文件夹中删除Roboguice JAR文件之一时,错误消失了。 显然,Android会从 /libs 拾取所有JAR文件,无论您在Java构建路径中指定了哪个文件。 我记不清了,但是我认为Android默认从 Android 4.0 (Ice Cream Sandwich,ICS)开始使用