Android Annotations: love at first sight

Here’s how to use Java Annotations in your Android code to make the code have better readability and maintenance.

narutosanjiv

Most Java programmers are already familiar with Java annotations.  Java annotations are used to provide meta data for your Java code.

Java annotations are typically used for the following purposes:

  •    Compiler instructions
  •    Build-time instructions
  •    Runtime instructions

Android programmers also use android annotations. Some of android annotations used are override, nullable, SuppressWarnings , etc.

Android programmers almost spend 20% of time their time on following task given below:

  •     find the android ui element by id
  •     Associates the layout with activity, fragment or  ViewGroups.
  •     Associating the Variables with String resource or other resources.
  •      SetClick handler for listview or other element.

Consider the case where you have large code base and people have defined about 20-30 variables. It will be nightmare for any developer to determine which ui element associates with which variable activity or fragments.

Here is an example of using android annotations, so that we can…

View original post 68 more words

Advertisements

About Gautam Rege

Rubyist, Entrepreneur and co-founder of Josh-Software - one of the leading Ruby development shops in India.
This entry was posted in General. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s