title: What is the correct way to write native method signatures in Android NDK?
body: <p>I have a working implementation of NDK library and corresponding Java-class. But I am not able to add overloaded method to that class. Currently my class contains:</p>
  
  <pre><code>package com.package;
  
  public class MyClass
  {
    public static native String getFileName();
    static
    {
      System.loadLibrary("mylib");
    }
  }
  </code></pre>
  
  <p>My jniwrappers.cpp file has the following declaration:</p>
  
  <pre><code>JNIEXPORT jstring JNICALL
  Java_com_package_MyClass_getFileName(_JNIEnv* env, jobject thiz);
  </code></pre>
  
  <p>Up to this point everything is working fine. But next I modify my class:</p>
  
  <pre><code>package com.package;
  
  public class MyClass
  {
    public static native String getFileName();
    public static native String getFileName(int index);
    ...
  }
  </code></pre>
  
  <p>And add to jniwrappers.cpp another declaration:</p>
  
  <pre><code>JNIEXPORT jstring JNICALL
  Java_com_package_MyClass_getFileName__I(_JNIEnv* env, jobject thiz, jint index);
  </code></pre>
  
  <p>It compiles fine, Android application starts, does not get UnsatisfiedLinkError but when it calls the second method with the argument the first C++ function is being called but not the second. I have other methods with arguments in that class but none of them are overloaded so their respective JNI signatures do not contain arguments.</p>
  
  <p>So, what am I doing wrong?</p>