Annotation Type UsedByNative


  • @Target({METHOD,FIELD,TYPE,CONSTRUCTOR})
    public @interface UsedByNative
    Annotation used for marking methods and fields that are called from native code. Useful for keeping components that would otherwise be removed by Proguard. Use the value parameter to mention a file that calls this method. Note that adding this annotation to a method is not enough to guarantee that it is kept - either its class must be referenced elsewhere in the program, or the class must be annotated with this as well. Usage example:
    
     @UsedByNative("NativeCrashHandler.cpp")
     public static void reportCrash(int signal, int code, int address) {
         ...
     }
     
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value  
    • Element Detail

      • value

        java.lang.String value