• About JNI Wrapper for Delphi and FreePascal..

    From World90@21:1/5 to All on Sat Oct 10 09:16:51 2020
    Hello...


    About JNI Wrapper for Delphi and FreePascal..

    I have just read the following paper:

    Efficient Cooperation between Java and Native
    Codes – JNI Performance Benchmark

    https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.109.5174&rep=rep1&type=pdf

    And it says the following:

    "Benchmark Summary

    As might have been expected, obtaining Java functionality from native
    code via JNI function calls turned out to be much slower than pure JIT-optimized Java. Nevertheless, the overhead factor rarely exceeded 30
    what is acceptable in most cases as JNI functions typically take only a
    small part in total native method execution time. Therefore, the overall
    JNI performance seems to be adequate for most applications where it
    really have to be used."


    So i think the following JNI Wrapper for Delphi and FreePascal is really useful, and it works on Windows (and i will perhaps soon port it to
    Linux), but notice in the following that the Market share of Windows is
    87.67%:

    https://netmarketshare.com/operating-system-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22deviceType%22%3A%7B%22%24in%22%3A%5B%22Desktop%2Flaptop%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%
    2C%22group%22%3A%22platform%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22platformsDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-10%22%2C%22dateEnd%22%3A%222020-09%22%2C%22segments%22%3A%22-1000%22%7D


    So here is JNI Wrapper for Delphi and FreePascal version 2.94 JNI that i
    have enhanced much more, and i think it is stable and complete, as you
    will notice that now JNI Wrapper automatically configure itself from the Windows registry to support new versions of Oracle Java.

    Authors: Jonathan Revusky, Amine Moulay Ramdane and Salvatore Meschini.

    Description:

    This JNI Wrapper for Delphi and FreePascal provides a powerful and
    simplified object-oriented API for doing mixed language programming in
    Java and Delphi (Object Pascal language) or FreePascal. This may provide
    an easier and more productive way of getting Win32 and Win64 features in
    Java projects and integrating legacy code (at least for the Delphi or FreePascal community). Please read the readme file inside the zip file
    to learn more.

    I have noticed that JNIWrapper for Delphi and FreePascal was not
    supporting returning of Strings and Arrays types from Java, so i have implemented that and i have now enhanced JNI Wrapper to be very powerful
    , so it's now supporting all the necessary functions and methods and and
    much more... hope you will happy with it cause i have worked hard to
    bring this new 2.94 to you, it is really now a professional software of
    a good quality.

    Also i have enhanced more JNI Wrapper and ported it to 64 bit and to
    both FreePascal and the Delphi XE versions and to Delphi tokyo, here is
    the functions that i have implemented and added:

    function JstringArrayToDTStrings(jarr : JArray) : TStrings;

    function JdoubleArrayToDdoubleArray(jarr : JdoubleArray) : TDdoubleArray;

    function JfloatArrayToDsingleArray(jarr : JFloatArray) : TDsingleArray;

    function JcharArrayToDwordArray(jarr : JCharArray) : TDwordArray;

    function JbyteArrayToDshortintArray(jarr : JByteArray) : TDshortintArray;

    function JshortArrayToDsmallintArray(jarr : JShortArray) : TDsmallintArray;

    function JbooleanArrayToDbooleanArray(jarr : JBooleanArray) :
    TDbooleanArray;

    And don't forget to call TJavaVM.freeRef() method from Delphi or
    FreePascal when you need to garbage collect and free the memory that was allocated.

    You can download JNI Wrapper for Delphi and FreePascal version 2.94 from
    my website here:

    https://sites.google.com/site/scalable68/jni-wrapper-for-delphi-and-freepascal


    Thank you,
    Amine Moulay Ramdane.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)