`
iaiai
  • 浏览: 2210831 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

简单试用Android Annotations

 
阅读更多
       Android Annotations号称 "是一个能够加速 Android 开发的开源框架,它可以帮助开发者处理

一些 前后台任务、rest 服务、应用类、代码片段等,让开发者专注于真正重要的东西”。

      为了看看实际 效果,今天搭建环境,简单试用了一下(只是跑起来了。。。)

一、准备工作

https://github.com/excilys/androidannotations 下载源码及相关的jar包
按照 [url]https://github.com/excilys/androidannotations/wiki/Eclipse-Project-Configuration [/url]上的步骤配置Eclipse


二、运行Demo
       将demo中examples\HelloWorldEclipse目录下的项目导入到Eclipse中,运行良好


三、运行简单工程
  1.工程目录

  2.配置Eclipse


3.代码
import com.googlecode.androidannotations.annotations.EActivity;

import android.app.Activity;

@EActivity(R.layout.activity_first)
public class FirstActivity extends Activity {

}

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/helloTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="17dp"
        android:layout_marginTop="15dp"
        android:text="TextView" />

</RelativeLayout>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.iaiai.test"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity android:name="com.iaiai.test.FirstActivity_" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
  • 大小: 17.3 KB
  • 大小: 95.9 KB
  • 大小: 94.1 KB
分享到:
评论

相关推荐

    Android annotations 注解 使用

    在Android开发中,注解(Annotations)是一种强大的工具,它能帮助我们简化代码,提高代码的可读性和可维护性。Android Annotations库是专门为Android应用设计的一个注解处理框架,它提供了一系列预定义的注解,可以...

    Android Annotations框架使用实例

    Android Annotations框架是一个强大的工具,它通过使用Java注解(Annotations)来简化Android应用的开发,提高了编码效率。本文将深入探讨Android Annotations的使用方法和优势,帮助开发者更好地理解和运用这一框架...

    android-support-annotations.jar.zip

    《Android Support Annotations详解》 Android Support Annotations库是Google为Android开发者提供的一套强大的注解工具,主要用于提升代码的可读性和可维护性,减少运行时错误,并简化编码过程。这个库是Android ...

    android-support-v4 .jar,android-support-annotations.jar

    标题提到的"android-support-v4 .jar"和"android-support-annotations.jar"是Android支持库中的两个关键组件。 "android-support-v4 .jar"是Android支持库的v4版本,它是对Android API Level 4(Android 1.6 Donut...

    android.support.annotations.jar

    《深入理解Android支持库:android.support.annotations.jar》 在Android应用开发中,`android.support.annotations.jar`是一个至关重要的组件,它是Google为开发者提供的一种支持库,主要用于解决在Eclipse环境中...

    android demo,annotations4.4.0和android studio3.0.1的配置使用的实现。

    在Android开发领域,Android Studio是主流的集成开发环境(IDE),而Annotations则是一种强大的编程工具,可以帮助开发者在代码中添加元数据,以实现各种功能,如注解处理器、依赖注入等。在这个`android demo`中,...

    Android annotations注解框架 源码

    功能:完全注解框架,一切皆为注解:声明控件,绑定控件,设置监听,setcontentview,长按事件,异步线程,全部通过注解实现。 优点:完全的注解,使开发起来更加便利,程序员写的代码也更少。...

    annotations.zip

    java.io.IOException: Could not parse XML from android/accounts/annotations.xml 原因:sdk下/platform-tools/api/annotations.zip这个文件里的xml文件不规范造成的。解决方法:到sdk目录下找到/platform-tools/...

    annotations-23.0.0-API文档-中文版.zip

    赠送jar包:annotations-23.0.0.jar; 赠送原API文档:annotations-23.0.0-javadoc.jar; 赠送源代码:annotations-23.0.0-sources.jar; 赠送Maven依赖信息文件:annotations-23.0.0.pom; 包含翻译后的API文档:...

    android-support-annotations.jar

    Android官方提供的一个注解库,它提供了许多有用的注解,这些注解的生命周期为源码时期,也就是在编译之后则不再保留,通常用于辅助代码上的静态检查

    AndroidSDK下/platform-tools/api/annotations.zip

    编译时遇到以下报错:app:...java.io.IOException: Could not parse XML from annotations/android/widget/annotations.xml 请将本文件替换SDK目录下的/platform-tools/api/annotations.zip文件,建议替换前备份原文件

    annotations.jar

    annotations.jar android.annotation.SuppressLint

    error_prone_annotations-2.3.2-API文档-中文版.zip

    赠送jar包:error_prone_annotations-2.3.2.jar; 赠送原API文档:error_prone_annotations-2.3.2-javadoc.jar; 赠送源代码:error_prone_annotations-2.3.2-sources.jar; 赠送Maven依赖信息文件:error_prone_...

    annotations

    在IT行业中,"annotations"是一个重要的概念,尤其是在Java和Android开发中。Annotations(注解)是一种元数据,它提供了在不改变程序行为的同时,向编译器或JVM提供额外信息的方式。这些信息可以用于代码分析、编译...

    jcip-annotations-1.0-1.jar

    jcip-annotations-1.0-1.jar

    support-annotations-28.0.0.jar

    support-annotations-28.0.0,自己用的eclipse的jar包,方便用户使用!

    annotations-13.0-API文档-中文版.zip

    赠送jar包:annotations-13.0.jar; 赠送原API文档:annotations-13.0-javadoc.jar; 赠送源代码:annotations-13.0-sources.jar; 赠送Maven依赖信息文件:annotations-13.0.pom; 包含翻译后的API文档:...

    androidannotationsexample:此 repo 显示了一个不工作的 android 注释示例,其中包含当前的 gradle 1.4 plaugin 和 Android Annotations 3.2

    此存储库显示了一个不工作的 Android Annotations 示例,其中包含当前的 android-gradle 插件 1.4 和 Android Annotations 3.2 该应用程序由一个主应用程序模块和一个库模块组成。 两者都使用 Android 注释 (AA)。 ...

Global site tag (gtag.js) - Google Analytics