javac#androidc++playstation3

How to use java to call C# Library that call a native C++ library


I am trying to make an android app for "Real Time Editing" on Playstation, and it depends on 2 libraries to function. One of which is coded in C# while the other is coded in Native C++. The C# lib use the Importdll function to make calls to the Native C++ code which in turn enacts with the PS3.

Example:

[DllImport("CCAPI.dll", EntryPoint="_ZN5CcApi13getDllVersionEv", CallingConvention=CallingConvention.Cdecl)]
    private static extern int getDllVersion();
    public int GetDllVersion()
    {
        return getDllVersion();
    }

The problem: The C++ library is not open source. And i don't think it's possible to use JNI to call methods within the C++ library without adding the java header. (Sorry if it sounds a little stupid, i'm literally DAY 1 new to JAVA).

I just was wondering if i can make a java version of PS3Lib (javaplugin) so it can work with CCAPI.dll.

C# Lib: PS3Lib.dll http://www.mediafire.com/download/chsvllkrmvb56vi/PS3Lib4.4.2.1.dll C++ Lib: CCAPI.dll http://www.mediafire.com/download/k5x3c1s6z26cuzt/CCAPI2.50.dll

Thanks, i appreciate anyone for even reading this. Any feedback would be greatly appreciated.


Solution

  • Found the answer I needed. You have to use JNI (Java Native Interface) to wrap the C# library and call the C++ methods.