potduang Member Licensed User Longtime User Aug 6, 2015 #1 Hi, First, I've to say sorry for my english ability. I'm new in working with external .jar file. May anyone can guide me how to work with it? Suppose I've a .jar file (for example CRC.jar). It contains CRC16.class and CRC32.class. In CRC16.class, there is a function public static short calcrc16(byte[] data, int len) How can I call and get result from calcrc16? I've added #AdditionalJar: CRC in my test application. After that I added a sub Sub GetCRC16 As JavaObject Dim jo As JavaObject End Sub Please anyone guide me what to do next. Best Regards, Piyapong.
Hi, First, I've to say sorry for my english ability. I'm new in working with external .jar file. May anyone can guide me how to work with it? Suppose I've a .jar file (for example CRC.jar). It contains CRC16.class and CRC32.class. In CRC16.class, there is a function public static short calcrc16(byte[] data, int len) How can I call and get result from calcrc16? I've added #AdditionalJar: CRC in my test application. After that I added a sub Sub GetCRC16 As JavaObject Dim jo As JavaObject End Sub Please anyone guide me what to do next. Best Regards, Piyapong.
Erel B4X founder Staff member Licensed User Longtime User Aug 6, 2015 #2 Code: Copy Dim jo As JavaObject jo.InitializeStatic("package.name.which.you.didnt.provide.CRC16") log(jo.RunMethod("calcrc16", Array (Array As Byte(1, 2, 3, 4), 4)) Upvote 0
Code: Copy Dim jo As JavaObject jo.InitializeStatic("package.name.which.you.didnt.provide.CRC16") log(jo.RunMethod("calcrc16", Array (Array As Byte(1, 2, 3, 4), 4))
potduang Member Licensed User Longtime User Aug 6, 2015 #4 Many Thanks Erel. I've just try and it's work correctly. Upvote 0