Calling JNI and Java API’s with Delphi and Appmethod

Following on from the iOS specific session that spoke about iOS and talking to Objective C API’s, Jim McKeeth has done a session on Java and the JNI (Java Native Interface) bridge to the Java API’s.

He speaks about conditional defines and how to use JNI to speak to a custom set of Java Libraries. While mainly in Object Pascal, the same technique is used to access via C++ and demos are done in both language.

The video covers the creation of class methods and regular methods that are then used with the TJavaGenericImport class to bring them all together ready for importing. (A walk through is also provided on DocWiki)

The example in the video covers a string being Base64 encoded using a JNI call. For the steps to create the custom classes.dex file  you can also see Jim’s blog post at