Adding Dagger To Your Android Project In Eclipse
来源:互联网 发布:知我药妆是不是正品 编辑:程序博客网 时间:2024/06/10 07:57
Today I started messing around with different dependency injection frameworks for Android. I am a big fan of the libraries put out by Square so naturally I wanted to try out their libraryDagger. Unfortunately the setup instructions are vague if you are not using maven in your project. For my purposes I just wanted to add the project to an existing (mavenless) Android project in Eclipse.
I found some steps in one of the help threads that were slightly outdated so I wanted to put out some updated instructions (with pictures) for those that came after me. In the end adding the library is very simple but there was some confusion over exactly which Jars I needed. It turns out that the dependency list for the project has grown slightly. If you miss that line at the very bottom of the projects website it can lead to an hour of frustration (maybe that is how you ended up here!).
I found some steps in one of the help threads that were slightly outdated so I wanted to put out some updated instructions (with pictures) for those that came after me. In the end adding the library is very simple but there was some confusion over exactly which Jars I needed. It turns out that the dependency list for the project has grown slightly. If you miss that line at the very bottom of the projects website it can lead to an hour of frustration (maybe that is how you ended up here!).
- First Download the jars files required for the project and add them to your libs folder in eclipse.
- Dagger 1.10 (at the time of this writing.. check for the latest version)
- Dagger 1.10 Compiler Jar (version number must match version of Dagger jar)
- javax.inject
- JavaWrite
- Now that those are added to the Libs folder we need to open our project properties and go to the Java Compiler screen. Check "Enable project specific settings"
3. Hit the little arrow on the left and select Annotation Processing". Here we need to check "Enable project specific settings" . Also make sure "Enable annotation processing" and "Enable processing in editor" are checked.
4. Finally go to "Factory Path" and then click "Add JARs". Add all the jars you downloaded in step one to this list and make sure the little box is checked next to each one. Disregard the butterknife jar in the image below. It is another awesome square library I happened to be using in this project.
5. Hit Apply and OK. Your application should do a clean/build and you should be good to go. If you are just getting started with Dagger I recommend taking a look at their Android samples (after reading the documentation of course).
0 0
- Adding Dagger To Your Android Project In Eclipse
- Adding Three20 to your Xcode project
- Adding a library/JAR to an Eclipse Android project
- Adding a library/JAR to an Eclipse Android project
- How to use Log4net in your project
- How to deploy maven project to tomcat inside your eclipse
- android-Supporting Swipe-to-Refresh,Adding Swipe-to-Refresh To Your App,
- How to add QuartzCore.framework for your project in xcode?
- How to use cocoa pod in your iOS project
- how to access current Project in eclipse?
- Adding OpenID to your web site in conjunction with ASP.NET Membership
- Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application
- Adding iAd in your App from Unity3d
- Adding Windows To Your Console Application
- Adding Logic Flow Control to Your Programming
- Adding RF 433MHz to your Arduino
- Adding Object Subscripting Support to Your Classes
- Adding Meaning to your steps轨迹导论
- 委托和线程
- HTML5 学习笔记 (1)
- 位运算笔记
- beagleboard-xm,angstrom,gcc入门手记
- git 常用命令
- Adding Dagger To Your Android Project In Eclipse
- 【Android】 Android应用程序的启动过程
- 对Class.getResourceAsStream和ClassLoader.getResourceAsStream方法所使用的资源路径的解释
- 目录
- 虚拟机linux和主机时间同步
- Hibernate主键生成策略
- UVA - 357Let Me Count The Ways(完全背包)
- Android 最火快速开发框架AndroidAnnotations使用详解
- Java与C#的比较学习记录