-1

I'm wondering if there is such framework or tool to define and declare controller in Android similar to IOS.

I don't want to have so many boilerplates for just defining a simple button or edittext controller using an xml and then create a handler for it inside code I want to use something similar following lines :

@controller

Button mybutton;

Is there any framework available for doing such in Android?(I googled it but I couldn't find any clue except for GreenDroid which is not I'm looking for)

Vahid Hashemi
  • 5,182
  • 10
  • 58
  • 88
  • 1
    you can set a onClick attribute in xml, for example. And then just create the same method in your activity. Or try this lib https://github.com/excilys/androidannotations – Lingviston Jun 15 '13 at 21:07
  • 1
    Android is built around the concept of declarative UI separated from code, which IMHO is a good thing. Forget iOS and learn the Android way. It is really simple to build UI in XML and hook in the event handlers. Most people add the handlers in code but you can of course declare the handlers in the XML. See this question - http://stackoverflow.com/questions/4153517/how-exactly-does-the-androidonclick-xml-attribute-differ-from-setonclicklistene – Simon Jun 15 '13 at 21:09
  • @user1897423 androidnotation was the one I was looking for. If you possibly write your note as answer I will accept it as the answer ;) – Vahid Hashemi Jun 15 '13 at 21:14

1 Answers1

1

Try this lib github.com/excilys/androidannotations.

P.S. But seriously listen to the @Simon and and try Android way;)

Lingviston
  • 5,479
  • 5
  • 35
  • 67