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)

http://docwiki.embarcadero.com/RADStudio/XE6/en/Using_a_Custom_Set_of_Java_Libraries_In_Your_RAD_Studio_Android_Apps

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 http://delphi.org/2014/07/custom-classes-dex/

2 thoughts on “Calling JNI and Java API’s with Delphi and Appmethod”

Leave a Reply

Your email address will not be published. Required fields are marked *