This is my first attempt to use an additional jar. I am using what we call in the UK a "monkey see; monkey do" approach - trying to copy what others seem to have done, not necessarily understanding what I am doing. Helped by posts on this forum I have constructed a test using the zip4J library that I have found at this link. Here is my complete program :
I am getting the error :
What have I missed?
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#AdditionalJar: zip4j-2.11.1.jar
#End Region
Sub Process_Globals
Private MainForm As Form
Private Button1 As B4XView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
End Sub
Sub Button1_Click
zip("E:/Temp/Waffle.jpg", "E:/Temp/Waffle.zip") ' Test sample
End Sub
Public Sub zip(filename As String, zipFile As String)
Dim zipper As JavaObject
Dim constants As JavaObject
zipper.InitializeNewInstance("net.lingala.zip4j.core.ZipFile", Array(zipFile))
constants.InitializeStatic("net.lingala.zip4j.util.Zip4jConstants")
zipper.RunMethod("addFile", Array(filename))
End Sub
I am getting the error :
java.lang.ClassNotFoundException: net.lingala$zip4j$core$ZipFile
What have I missed?