Your question is already answered here.
So in short, yes and sort of.
You can create custom annotations for logging or any other purpose, but you have to implement a code that checks for annotations in classes, using reflection that is available for Android as well.
If this is important for you then you should create a proxy object that gets a service name, method + paramlist params.
Something like this:
Call:
callServiceMethod("UploaderService","onUploadProductSuccess",productServerId);
Method source:
public void callServiceMethod(String serviceName, String methodName, Object... paramList){
Object service = ;//getting the service object by name
//getting the method
Method method = service.getClass().getMethod(methodName, paramList[0].class,...);
for ( Annotation a : m.getAnnotations() ) {
// if the annotation found then write to log
}
//in the end:
method.invoke(service , paramList[0], ...);
}
in this method you can check the called service for your annotations before calls the actual method.
As you can see the method is called and the log is written, but instead of calling UploaderService.onUploadProductSuccess you have to call the method above.