Android annotation

Now I have spent about 5-6 months since I work on Android. We went through a few points and are still in the process of learning. A few days ago I found out about android annotations . A great way to shorten our code and focus strictly on BL. But to continue studying the annotation I need materials that I don’t get a lot of details. I found some good things, like a simple annotation example , as well as github, to me a little more example here . But still, I really want to dig deeper, as the annotation is concerned. Where can I find more annotation related content? Can anyone help me on this. I know that this is not directly related to programming, but you still need help only from programmers.

Updated . I got another link for annotation, an insert for updating users. Here is the link.

+4
source share
2 answers

I'm not quite sure what you are asking for sure. AndroidAnnotation generates class A_ with annotated class A. You can open A_ and see what is generated.

If you don’t learn a little more about annotations per se, you can check out this article http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6 -compiler-apis.html Quickly, annotation processing works as follows:

  • Class analysis to retrieve a list of methods and attributes
  • For each method and attribute, if there are annotations to them, create some things (generating code, ...)

Hope I gave you some answers.

EDIT: If you don’t get any feedback, my staff and I will be using AndroidAnnotations for a large company for a year now, and it works great. We can focus on functionality.

+5
source

LightAndroidAnnotation is a very small Android annotation library. All annotation implementation codes are in only one class: Injector.java

This is just some basic use of Java reflection and annotation. Can help you.

-1
source

Source: https://habr.com/ru/post/1441250/


All Articles