title: jni not support types as void*, unsigned int*, .... What to do?
body: <p>I have <strong>.so</strong> (shared library) written in C++, lets call it <strong>functionality.so</strong> in which I implement different functions, here is list of some functions:</p>
  
  <pre><code>1. unsigned long Initialize(void* userData);
  2. unsigned long Uninitialize(void);
  3. unsigned long DeviceOpen( unsigned long id, unsigned long* device);
  4. unsigned long DeviceClose( unsigned long device );
  </code></pre>
  
  <p>and so on ...</p>
  
  <p>I want to use this library's (<strong>functionality.so</strong>) functionality in my java application for android. For that I create jni folder in my android application project folder and place there files:</p>
  
  <ol>
  <li><p><strong>Android.mk</strong></p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_MODULE           := Test_library
  LOCAL_SRC_FILES        := Test_library.c
  ## Linking functionality library
  LOCAL_LDLIBS := -lfunctionality
  include $(BUILD_SHARED_LIBRARY)
  </code></pre></li>
  <li><p><strong>Test_library.c</strong></p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;jni.h&gt;
  #include "Test_library.h"
  
  jint Java_com_Dsm_Test_DsmLibraryTest_vtUninitialize(JNIEnv* env, jobject thiz) {
  return Uninitialize( );
  }
  
  jint Java_com_Dsm_Test_DsmLibraryTest_vtDeviceClose(JNIEnv* env, jobject thiz, jint hDevice) {
  return DeviceClose( hDevice );
  }
  </code></pre></li>
  <li><p><strong>Test_library.h</strong></p>
  
  <p>A header file where <strong>Initialize</strong>, <strong>Uninitialize</strong>, <strong>DeviceOpen</strong>, <strong>DeviceClose</strong> functions are declared.</p></li>
  </ol>
  
  <p>After this I run <strong>ndk-build</strong> and create a Test_library.so library and load it in my java application and use them like this:</p>
  
  <pre><code>// Some code
  
  public native int Uninitialize( );
  
  public native int DeviceClose( int hDevice );
  
  static {
      System.loadLibrary("Test_library");
  }
  </code></pre>
  
  <p>Everything Runs fine. After I want to add other two functions </p>
  
  <pre><code>1. unsigned long Initialize(void* userData);
  2. unsigned long DeviceOpen( unsigned long id, unsigned long* device);
  </code></pre>
  
  <p>`</p>
  
  <h1>Now Questions:</h1>
  
  <ol>
  <li>How I can write this two functions as native in java ? As there are no <strong>void*</strong> or <strong>unsigned long*</strong> types in java </li>
  <li>How I can write same functions in Test_library.c as in jni.h there are no <em>void</em>** or <strong>unsigned long*</strong> types</li>
  </ol>
  
  <p>Thanks for help.</p>