These annotations are not ActionBarSherlock and yes Android Annotations .
ActionBarSherlock is responsible for offering a compatibility implementation of ActionBar
for devices with Android version less than 3.0. Currently the appcompat
library already provides this compatibility implementation, no longer needing to use ActionBarSherlock . In addition, the ActionBar
itself is falling into disuse in favor of Toolbar
of version 5.0, which appcompat
also provides compatibility.
The Android Annotations library adds some annotations, which serve as shortcuts to certain actions, features, and declarations, which in general reduce the amount of redundant, boilerplate written code. The biggest advantage dictated by the creators of the library would be to increase productivity.
Example:
@ViewById -> chama o findViewById da Activity após o setContentView
@EActivity -> chama o setContentView com o id especificado na anotação
The use of this library has its advantages and disadvantages, it depends a lot on each project / team.
The suffix _
in NomeActivity_
is a side effect, because for each annotated class, for example NomeActivity
, generates a new class with that suffix, with all the self-generated code corresponding to each of these annotations .
These functions do not at first impact performance because all extra code is generated at compile time, but the code may not be the most optimized (sometimes this does not even matter for readability / productivity).
You can look in the gen
of Eclipse folder or search for it using Ctrl-R
or Ctrl-T
and see the auto-generated code.
In the case of Android Studio , I believe you need to target/generated-sources/annotations
and you will see the generated code.
For more details: link
About the release, both libraries support Android 2.3. I suggest you take a look at which libraries the project has and check on the AndroidManifest of which versions they put at least.
If you do not have any, I recommend doing a very careful test / analysis in the code as there may be calls to the API of newer versions that will generate run-time error (some lint may be warning at compile time). E.g: Animation API (ObjectAnimator, ValueAnimator, ViewPropertyAnimator and etc ...).