Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
125 views

Issue processing annotations in Composable functions on Android with Kotlin

I'm having trouble processing annotations in Composable functions on my Android project. My goal is to add a custom annotation, let's say @CustomComponent, to my Composable functions and then be able ...
Juan Fraga's user avatar
1 vote
0 answers
396 views

Modify a method definition's annotation String parameter at runtime on Android

As the title says I'm trying to modify a method's annotation String parameter at runtime in Java on Android. I've found an answer to another question asked some time ago which should solve the problem....
Nico Feulner's user avatar
1 vote
1 answer
749 views

Wrap a method in commands using Annotation Processing

I have a bunch of tasks that need to be performed before and after a method call. My approach is to use annotation processing, and a custom annotation to do this. @BeforeSomething(task = 'something')...
Tyler's user avatar
  • 20k
0 votes
1 answer
1k views

Annotate a function and detect when it is called at Runtime - Kotlin/Java

Hello let me try to make this clear: I want to do almost the same thing the Android annotations do. For example : @RequiresApi(Build.VERSION_CODES.LOLLIPOP) public void someFunction() { } I would ...
rygelouv's user avatar
-3 votes
1 answer
36 views

Code generator for Android layout files from using Java Annotations

Is there any library that could help in generating XML (layout) files in android. I have explored java poet but it is not helping in XML files.
ila's user avatar
  • 920
0 votes
4 answers
2k views

JAVA : How to get the name of variable with annotation in Java?

I am trying to get the name of variable in android using java. The variable has a annotation, and I want to get the variable's name with the annotation's name. is this possible? just like this, @...
user avatar
7 votes
1 answer
7k views

GSON Custom serialization with annotations

I have a very specific case of custom serialization with GSON: Let's say I have a following class: public class Student extends BaseModel{ private int id; private String name; private ...
jdabrowski's user avatar
  • 1,985
1 vote
1 answer
2k views

Android create custom annotations

I'm learning how to create own annotations. I have read this: http://www.mkyong.com/java/java-custom-annotations-example/ but I have to pass all classes with my annotation - thats bad. So I have read ...
Lau's user avatar
  • 1,834
4 votes
1 answer
1k views

How expensive is call of Class.isAnnotationPresent(...)?

I'm wondering how expensive this operation can be on following runtimes: JVM8 Dalvik ART The information about annotations of given class (target=TYPE) is available in compile time, so I'd guess that ...
Zbigniew Malinowski's user avatar
2 votes
1 answer
351 views

Custom annotation Java / android

I'm trying to make some custom annotations to reduce boiler plate code in my android apps. I know it is doable since there are many libraries using the same technique, e.g. ButterKnife. So Imagine ...
Kasra's user avatar
  • 3,165
0 votes
1 answer
192 views

How can I specify the type of the field that an Annotation should be applied to in Java?

I'm creating a simple annotation, to help me inflating settings inside my Android application. The annotation is this: @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface ...
Luis Eduardo Brito's user avatar
0 votes
1 answer
388 views

ORMlite, faster if I *REMOVE* annotations?

in ormlite the annotations @DatabaseField are used to help create the database schema configuration file, and it then uses the configuration file for referencing variables in model objects, if I ...
CQM's user avatar
  • 44.4k
0 votes
1 answer
680 views

Reflect annotations from android activity class

I am developing an API to be used in Android. I want to use reflection to access annotations that are implemented in the android activity class. I need to reflect it from my API. There is a way to do ...
aleludovici's user avatar
3 votes
3 answers
2k views

Java "settings object", serialization/deserialization

(Code is for Android Actually, I need code to be portable between Android and Java SE.) I want to have a "settings" class with various game settings, like public int map_size; public String ...
hmp's user avatar
  • 941