0

I`m trying jni call with static method which returing Enumeration in android api.

But, I can`t figure out signature of return type of below method. "Enumeration getNetworkInterfaces ()"

Does anyone know?

  • 1
    Take a look at this: http://stackoverflow.com/questions/11225261/how-to-return-enum-from-jni and this http://stackoverflow.com/questions/18073297/how-to-get-the-value-of-an-enum-being-passed-to-the-jni – Arsen Davtyan Oct 11 '16 at 16:38

1 Answers1

2
javap -s java.net.NetworkInterface | grep -A 2 "getNetworkInterfaces"

gives

public static java.util.Enumeration<java.net.NetworkInterface> getNetworkInterfaces() throws java.net.SocketException;
Signature: ()Ljava/util/Enumeration;

so, the return type is "Ljava/util/Enumeration;"

(In general, when using javap, add the classpath argument if necessary.)

Java implements generics with "type erasure" so in JNI you won't see them.

Tom Blodget
  • 20,260
  • 3
  • 39
  • 72