Android: How to automatically generate Java code from layout file?

http://stackoverflow.com/questions/7462022/android-how-to-automatically-generate-java-code-from-layout-file

Normally there are three different ways to do this:

  1. at run time (via annotations per reflection)
  2. at compile time (via annotations or aspects)
  3. at development time (via code generators)

A good article to start is Clean Code in Android Applications.

Ad 1) Two solutions, see

Ad 2) Android Annotations, see http://androidannotations.org/

Ad 3) Two solutions, see

 

Be a lazy but a productive android developer – Part 7 – Useful tools

http://www.technotalkative.com/lazy-android-part-7-useful-tools/