B4A Library ProBundle

ProBundle contains all the following libraries:

- ArchiverPlusZip v1.13
Based on the Zip4j library, this library allows to add, extract, update and remove files from a zip archive.
It supports encryption and decryption (standard and AES), Zip64 format and split zip archives. It is compatible with B4J.

- ClassLoader v1.0
This library can dynamically load classes from a separate file (JAR or uninstalled APK) at runtime and verify the file signatures to make sure of its origin and integrity.
You can use the library to create plug-ins, load code encrypted in the assets or download code from a remote server, for example.

- CPUFeatures + source v1.0
This library detects the target device's CPU family and the maximum number of CPU cores.

- DataCollection v1.07
This library wraps the ArrayDeque, BitSet, PriorityQueue, SparseArray, Stack, TreeMap and TreeSet classes. These classes can replace your lists, maps or arrays for specific tasks. A TreeSet, for example, can maintain a sorted list of objects in a more efficient manner than a typical List class. A TreeMap is a map whose entries are sorted by their keys. A SparseArray is also a sorted map, but restricted to integer keys, that is lightning-fast.
This library can serialize to an array of bytes any collection, including Map, List and user defined types. A version for B4J is provided (without the SparseArray).

- F5Steg v1.2
This library implements F5, a secure steganographic algorithm, which embeds data into images. Data are encrypted with a password or, by default, with the application signature (thus any tampering of the APK will prevent from extracting valid data).

- FastIO + source v0.9
This library replaces the Read and Write functions (with their encrypted variant) of the RandomAccessFile library for arrays of bytes. These new functions are a lot faster.

- OverlayWindow + source v1.2
This library allows to create overlay windows and floating buttons. These interactive views can be displayed on top of all other applications.

- PackageUtils v2.1
This library replaces the PackageManager class of the Phone library. It gives plenty of informations on packages (activities, features, permissions, receivers, services, etc.) and can list the features available on the system (camera, gps, wifi, etc.). It allows experts to change the enabled state of components.
An application is provided with the library to show what you can get with it.

- UltimateArchiver v0.91
This library wraps P7Zip, a command line utility that can create archives with the 7z, zip, bzip2, gzip, tar or xz format. It can unpack files with extension 7z, cab, gz, img, iso, jar, rar, tar, zip and a few others.
It supports encryption/decryption and volumes. It is written in C to be as fast as possible.

- UnArchiver7z v1.0
Based on the official source code in C of 7zip, this library allows to extract files from a 7z archive compressed with the Lzma or Lzma2 method. It can unpack an archive directly from the assets.
It does not support decryption.

- UnArchiverRar v1.04
Based on the official source code in C++ of the UnRar.dll, this library allows to extract files from a Rar archive.
It supports decryption, Rar5 format, QuickOpen records and split Rar archives.

Since September 2018, ProBundle is available for free. You can still donate for it if you wish.
To send the money, just click on the Donate button below (the amount to enter is in euros):


CURRENT VERSION : ProBundle 1.22

DOWNLOAD HERE:
 
Last edited:

aidymp

Well-Known Member
Licensed User
Longtime User
Regarding the CoverFlow lib is there a way to "wrap a round" the list?

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
Regarding the CoverFlow lib is there a way to "wrap a round" the list?

Thanks

Aidy
The only way for now is to repeat many many times the same list. If you select a starting position in the middle of this long repeated list, scrolling to the left or to the right gives the feeling that the list is infinite. As the images are loaded only when needed, the memory consumption stays low. It's a poor trick, I agree, but there's no other way to do that. Maybe I will add an option in the future.
 

Informatix

Expert
Licensed User
Longtime User
There's a new version available for download for ProBundle and the guides.

Changelog:
- I fixed a bug in the C code of F5Steg. This library did not work on some devices;
- I fixed the same bug in the C template of SecureVaultGenerator;
- I fixed a bug in DataCollection. Array of objects were not properly serialized;
- I added two sections to the MySecureVault guide (What should I protect? and Troubleshooting);
- I updated the Proguard files and added two new examples (for HttpUtils2+OkHttp and UltimateListView);
- The byte arrays are now compressed by SecureVaultGenerator.
 

aidymp

Well-Known Member
Licensed User
Longtime User
There's a new version available for download for ProBundle and the guides.

Changelog:
- I fixed a bug in the C code of F5Steg. This library did not work on some devices;
- I fixed the same bug in the C template of SecureVaultGenerator;
- I fixed a bug in DataCollection. Array of objects were not properly serialized;
- I added two sections to the MySecureVault guide (What should I protect? and Troubleshooting);
- I updated the Proguard files and added two new examples (for HttpUtils2+OkHttp and UltimateListView);
- The byte arrays are now compressed by SecureVaultGenerator.

You really do spoil us! ;)

As you know I like to ask the most stupid questions! So here is stupid question number 230923, Would the ArchiverPlusZip lib work on B4j?

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
There's a new version of ProBundle. I added two libraries, ClassLoader and CPUFeatures, and I updated ArchiverPlusUnrar with the latest available C code.

ClassLoader can dynamically load classes from a separate file (JAR or uninstalled APK) at runtime and verify the file signatures to make sure of its origin.
This library can be used to create plug-ins, load code encrypted in the assets or download code from a remote server, for example.

CPUFeatures detects the target device's CPU family and the maximum number of CPU cores.

Changelog v1.08:
- I added the ClassLoader library with a demo;
- I added the CPUFeatures library with its Java and C source code;
- I updated ArchiverPlusUnrar with the latest available C code;
- I added a native add-on to ArchiverPlusUnRar and F5Steg with a read_me file.
 
Last edited:

wonder

Expert
Licensed User
Longtime User
Hi Fred,

I'm developing a game where my character throws bombs and I would like to use a dynamic array of lgTextureRegions.

Since I never use lists (in-game), I usually do something like this:
B4X:
Sub Globals
    Dim BombArray() as lgTextureRegion
End Sub

'Adds a new bomb to the current amount of bombs on screen.
Sub ThrowBomb
    Dim tempArray = BombArray as lgTextureRegion
    Dim BombArray(tempArray.Lenght + 1)
    For i = 0 To (tempArray.Lenght - 1)
        BombArray(i) = tempArray(i)
    Next
    BombArray(BombArray.Lenght - 1).Initialize
    BombArray(BombArray.Lenght - 1).Texture = ....
    ...
    ...
End Sub

Is there a more efficient way to do it, using any of the structures provided in the ProBundle?
 

Informatix

Expert
Licensed User
Longtime User
Hi Fred,

I'm developing a game where my character throws bombs and I would like to use a dynamic array of lgTextureRegions.

Since I never use lists (in-game), I usually do something like this:
B4X:
Sub Globals
    Dim BombArray() as lgTextureRegion
End Sub

'Adds a new bomb to the current amount of bombs on screen.
Sub ThrowBomb
    Dim tempArray = BombArray as lgTextureRegion
    Dim BombArray(tempArray.Lenght + 1)
    For i = 0 To (tempArray.Lenght - 1)
        BombArray(i) = tempArray(i)
    Next
    BombArray(BombArray.Lenght - 1).Initialize
    BombArray(BombArray.Lenght - 1).Texture = ....
    ...
    ...
End Sub

Is there a more efficient way to do it, using any of the structures provided in the ProBundle?
95% of my data structures are arrays in my games because nothing is faster. If you need to sort your arrays, you can do it with a few java lines or with the library for arrays made by Agraham. I use specialized collections when I need something specific, not possible with arrays, or when the convenience of use is more important than speed.
Note that your code above has a major flaw: it resizes the array repeatedly. A dynamic array is not really compatible with performance (especially for large arrays). In your create event, you should size all arrays at their maximum capacity to avoid resizing them.
If you want to implement a dynamic pool, just memorize the index of the last entry in a fixed size array. When you release an entry, move all entries after the gap to fill it (it's a simple loop that moves references starting from the last entry; it's extremely fast). So the next available entry in the pool is always the index of the last entry + 1. It's what I used for the opponents, the projectiles and the miscellaenous sprites in my tower game. Reusing objects is a major key for good performance. Without allocation/deallocation, you save time and you avoid also the garbage collections.
 

Informatix

Expert
Licensed User
Longtime User
So, it's kinda like a pointer in C/C++! Got it! :)
Thank you so much! ;)
When you create an object in Java (Object myObject = new Object()), you create a pointer on this object and when you call a function with this object as parameter, you pass the address of the object (its reference), never the object itself. Primitive types are a special case as usual and, contrary to C, you cannot pass a pointer on them, just the value they hold. That's why Java is a "pass-by-value" language. Either you pass the value of the address when it's an object, or the stored value when it's a primitive.
 

wonder

Expert
Licensed User
Longtime User
When you create an object in Java (Object myObject = new Object()), you create a pointer on this object and when you call a function with this object as parameter, you pass the address of the object (its reference), never the object itself. Primitive types are a special case as usual and, contrary to C, you cannot pass a pointer on them, just the value they hold. That's why Java is a "pass-by-value" language. Either you pass the value of the address when it's an object, or the stored value when it's a primitive.
You have just answered a question that was lingering on my mind for a really long time!
Now I understand why my variables behave differently from objects.
 

DonManfred

Expert
Licensed User
Longtime User
I don't know exactly as I'm not a B4J user
If the lib does not use Android specific methods then it should work. Android Async Task for example will not work in a B4J library.

You need to use the B4J Version of SLC to compile it to a b4j library.
Maybe you can give it a try?
 
Top