I need to be able to zip a large number of .jpg and .mp4 files using B4J.
For what purpose?
To
use in a B4X app? doesn't have to be same app as did the compressing
in which case, try the archiver library
https://www.b4x.com/android/forum/threads/lib-archiver.21688/ or similar
I usually use CompressedStreams which is bundled with the RandomAccessFile library, but it only does one file at a time, ie doesn't bundle multiple files into one compressed archive (but having said that, because it's a stream, it's easy enough to do that yourself into a simple handcoded format if you really need it)
https://www.b4x.com/b4j/help/jrandomaccessfile.html#compressedstreams
Or
to use in other programs, eg Windows File Explorer?
in which case, use 7-Zip (or even Windows File Explorer?)
both can produce 64-bit Zip files (not sure if they can produce the older format Zip files, which have a 2GB file size limit)
if you the compression has to be done within B4X app, then try the archiver library mentioned above
Also, are you intending to have multiple images inside one compressed file, or to do the each-in-its-own .gz style?
In fact, now I'm thinking: are you doing this just to organise multiple files into one? Because JPEG and MP* files (and GIF and PNG files) are already pretty tight, and general compression algorithms don't usually have much effect on them. If you're looking to save space, then the usual route is to decrease the resolution and quality settings of the codec used to produce the files in the previous step.