title: Monodroid JNI for Java reflection to call a private method
body: <p>In a Monodroid project, I need to be able to call a private method on a class.  From <a href="https://stackoverflow.com/a/12610875/362536">an answer on a related question</a>, it seems that this is possible in Java via reflection:</p>
  
  <pre><code>import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
  import android.os.ParcelFileDescriptor;
  
  ...
  
  ParcelFileDescriptor pipe[] = null;
  
  try {
      Method createPipeMethod = ParcelFileDescriptor.class.getDeclaredMethod("createPipe");
      pipe = (ParcelFileDescriptor[]) createPipeMethod.invoke(null);
  } catch (NoSuchMethodException e) {
      throw new RuntimeException(e);
  } catch (IllegalAccessException e) {
          throw new RuntimeException(e);
  } catch (InvocationTargetException e) {
      throw new RuntimeException(e);
  }
  </code></pre>
  
  <p>I need to use this code from Monodroid.  Unfortunately, <a href="https://stackoverflow.com/a/11376050/362536"><code>java.lang.reflect</code> is not available in Monodroid</a>.  However, it has been suggested that I can run this code using JNI from my Monodroid project.  The <a href="http://docs.xamarin.com/android/advanced_topics/Java_Integration_Overview" rel="nofollow noreferrer">Xamarin documentation states that inline JNI is possible</a>, without having to bind a whole JAR.  Unfortunately, <a href="http://docs.xamarin.com/android/advanced_topics/Working_With_JNI" rel="nofollow noreferrer">further documentation</a> doesn't say anything more on the subject.  Furthermore, the <a href="http://androidapi.xamarin.com/?link=T:Android.Runtime.JNIEnv" rel="nofollow noreferrer">documentation on JNIEnv</a> is blank.</p>
  
  <p>It looks like I need <code>JNIEnv.CallVoidMethod()</code>, but I have no idea how to do it.  I can't find an example, or further documentation.</p>
  
  <p><strong>How can I use <code>java.lang.reflect</code> in my Monodroid project, or in some other way call the private method <code>.createPipe</code> on <code>ParcelFileDescriptor</code>?</strong></p>