Intellij12 配置androidannotations
今天废了好大的劲才勉强将androidannotations配置出来,至于androidannotations是做什么的就请各位在github上自行查找了。这里只将我的搭建过程写出来,欢迎其他各位搭建成功的朋友指导。
1、下载androidannotations
地址:https://github.com/excilys/androidannotations
官网地址:http://androidannotations.org/
这里解压过后的样子应该如图:
2、启动Intellij 12,创建新的工程空间project
(注意一定要是新的project,不是module,因为在这里我试验过,
如果创建的是module,到时候配置过后编译程序总会报错,
说是在路径下找不到Androidmanifest.xml,如果有朋友解决了请给我留言)。
3、配置androidannotations路径。
在项目上单击右键open module setting(或者快捷键F12),打开配置窗口,在Dependicies中单击+号-》jars or directs,选择你解压缩的androidannotations-api-2.7.1.jar,之后确认。
4、在功能栏选择File-》Settings,设置androidannotations-2.7.1.jar路径,如图:
5、回到工作空间,这时我们就可以使用androidannotations注解了,使用方法详见https://github.com/excilys/androidannotations/wiki
6、最后要注意的是当你使用@EActivity注解Activity的时候在AndroidManifest.xml当中的Activity声明要加“_”下划线,类似
<activity android:name="MyActivity_" android:label="@string/app_name"></activity>,具体原因还是参见官方文档吧。
希望大家能将环境搭建成功,同时希望其他搭建成功的大牛留点宝贵的意见。
最后把我的打包一下发上来:androidannotations 测试代码
参考:
http://www.jayway.com/2012/08/31/making-androidannotations-work-with-intellij-idea
http://www.ashokgelal.com/2012/12/setting-up-intellij-idea-12-with-maven-actionbarsherlock-roboelectric-androidannotations/
http://www.sapandiwakar.in/technical/building-android-applications-using-android-annotations/
http://lomza.people.totem-soft.com/?p=206
更多相关文章
- Android(安卓)Gradle Plugin指南(二)——基本项目
- ARM11Mini6410 Android(安卓)开发环境搭建 [李园7舍_404]
- 一个用于导出android项目配置宏为单个独立xml文件的shell脚本
- 使用MySQL和Servlet编写Android接口样例
- Android(安卓)学习笔记1
- Android(安卓)Studio 环境搭建、配置和基本使用
- FileProvider的使用
- Appium环境搭建教程
- android 上传文件到 spring 搭建的后台