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:

Informatix

Expert
Licensed User
Longtime User
In the new version, I added the PDFium library and the OverlayButton.Initialize2 function to OverlayWindow.

PDFium:
It is a fast PDF renderer, written in C, working with any Android version >= 2.3 (Gingerbread). It can open protected PDF (with the password), get the metadata, get the table of contents, get the text of each page, search through the whole document and render the annotations. It includes a navigator.

You can download the APK of the PDFium demo here:
https://drive.google.com/open?id=0B-kneWWcCy7PdHFfa0FxMXNfRzQ
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Fred,

I tried the demo apk of the pdfviewer. Getting the below error when i go to the second page.
B4X:
main_vvvvvvvv7 (java line: -1)
java.lang.OutOfMemoryError: Failed to allocate a 171740172 byte allocation with 16777216 free bytes and 85MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:975)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:946)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
    at b4a.classes.k.b(Unknown Source)
    at flm.b4a.demopdfium.main._vvvvvvvv7(Unknown Source)
    at flm.b4a.demopdfium.main._vvvvvvvv5(Unknown Source)
    at flm.b4a.demopdfium.main._pdf_afterjump(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
    at b4a.classes.C.a(Unknown Source)
    at flm.b4a.demopdfium.main._buttonnext_click(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(Unknown Source)
    at android.view.View.performClick(View.java:5702)
    at android.widget.TextView.performClick(TextView.java:10888)

Best,
SK
 

Informatix

Expert
Licensed User
Longtime User
Hi Fred,

I tried the demo apk of the pdfviewer. Getting the below error when i go to the second page.
B4X:
main_vvvvvvvv7 (java line: -1)
java.lang.OutOfMemoryError: Failed to allocate a 171740172 byte allocation with 16777216 free bytes and 85MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:975)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:946)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
    at b4a.classes.k.b(Unknown Source)
    at flm.b4a.demopdfium.main._vvvvvvvv7(Unknown Source)
    at flm.b4a.demopdfium.main._vvvvvvvv5(Unknown Source)
    at flm.b4a.demopdfium.main._pdf_afterjump(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
    at b4a.classes.C.a(Unknown Source)
    at flm.b4a.demopdfium.main._buttonnext_click(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(Unknown Source)
    at android.view.View.performClick(View.java:5702)
    at android.widget.TextView.performClick(TextView.java:10888)

Best,
SK
As you can read in your error message, it's due to a lack of memory. My viewer in the demo is very rudimentary and does not try to save as much memory as possible (a quick solution could be to set a LargeHeap in the manifest or to reduce the size of rendered bitmaps).
Note that I use a Webview as the main component because it's very convenient to do a quick demo, but it's not what I would choose for a real bitmap viewer.
 

ilan

Expert
Licensed User
Longtime User
hi, i just read the explanation of the libs that are included.
i am used to have a much more detailed explanation from you but this time u choosed to make it short :D

so i will ask a few questions:

about ClassLoader v1.0
so what i have understood is that i can put a piece of code for example to a txt file and then in a button_click event i can load that code and the button will perform it?
have i understood correctly or am i completely wrong? because if that is possible then this would be amazing, i could update my code without to have to upload a new build (apk) i can just download from a server the new code and use it.


CallSubExtended v2.0
run a sub in a different thread to parallelize execution

can you please give an example how that could be useful?

Error Detection + source v1.2
This library converts the OutOfMemory error and StackOverflow error to RuntimeException for a given sub, allowing to catch them. It can also detect when the UI is frozen before an ApplicationNotResponding error is thrown.

so that mean that i could catch the outofmemory and avoid a crash? or when the application stop responding i could quickly send some information about the error ?

OverlayWindow + source v1.1
are those windows that i have outside the app on the screen? and that i could move them around? something like this: https://www.b4x.com/android/forum/threads/cam-fun-work-in-progress.70265/

thanks and sorry for all those questions :)
 

DonManfred

Expert
Licensed User
Longtime User
are those windows that i have outside the app on the screen? and that i could move them around
Yes. Yes (if i remember correctly).
 

Informatix

Expert
Licensed User
Longtime User
hi, i just read the explanation of the libs that are included.
i am used to have a much more detailed explanation from you but this time u choosed to make it short :D

so i will ask a few questions:

about ClassLoader v1.0
so what i have understood is that i can put a piece of code for example to a txt file and then in a button_click event i can load that code and the button will perform it?
have i understood correctly or am i completely wrong? because if that is possible then this would be amazing, i could update my code without to have to upload a new build (apk) i can just download from a server the new code and use it.


CallSubExtended v2.0


can you please give an example how that could be useful?

Error Detection + source v1.2


so that mean that i could catch the outofmemory and avoid a crash? or when the application stop responding i could quickly send some information about the error ?

OverlayWindow + source v1.1
are those windows that i have outside the app on the screen? and that i could move them around? something like this: https://www.b4x.com/android/forum/threads/cam-fun-work-in-progress.70265/

thanks and sorry for all those questions :)
Try the examples. That will show you some concrete uses.
ClassLoader is not at all an interpreter or compiler, just a loader of JAR (or uninstalled APK) at runtime. For example, you can download a JAR file (e.g. a B4A library) from your server and run it dynamically. To interpret code at runtime, you should use the BasicLibIDE library instead. You will find it in the ProtectMyApp zip.
CallSubExtended is useful anytime you need to parallelize an execution (for example, you want to compute a GPS path while the UI is still responsive) and is simpler to use than the Threading lib.
ErrorDetection can trap OutOfMemory and, yes, avoid a crash.
 

ilan

Expert
Licensed User
Longtime User
Try the examples. That will show you some concrete uses.

i would like to but the only file i see in post#1 is ProBundleHelp that contains some html files.

CallSubExtended is useful anytime you need to parallelize an execution (for example, you want to compute a GPS path while the UI is still responsive) and is simpler to use than the Threading lib.

so it is something like a service?

thanks
 

DonManfred

Expert
Licensed User
Longtime User
so it is something like a service?
I think it is more an alternative to the threading-lib which is hard to work with.
You call a sub, the sub in running in a new Thread (like threading lib) not blocking your ui and you maybe get an event when the sub is finished (don´t know exactly as i did not try the sample).
 

ilan

Expert
Licensed User
Longtime User
I think it is more an alternative to the threading-lib which is hard to work with.
You call a sub, the sub in running in a new Thread (like threading lib) not blocking your ui and you maybe get an event when the sub is finished (don´t know exactly as i did not try the sample).

i have no experience with the threading lib but to know that you can run a task in background is good.
like this i could run a loop and show progressdialogshow what is not possible now because the progressdialog freezes until the loop is finished (something that i never understood, the whole point of a progressidalog is to give the user the filling that the app is working and that it is not stuck but if the progressdialog freezes until the loop is finish then there is no point to show it)
 

DonManfred

Expert
Licensed User
Longtime User
here is no point to show it
you can simply use one of the nice loadingviews and show them before you call the sub (with the probundle-lib) and when finished you hide the loadingview...
Or you can use a timer to control another loadingview while the sub is running...
 

Informatix

Expert
Licensed User
Longtime User
i would like to but the only file i see in post#1 is ProBundleHelp that contains some html files.
Oh sorry, I considered you as a lib owner.

so it is something like a service?
No. You just call any sub of your app with the library and it is run in another thread, instead of the UI thread. In an example, I show that you can do a heavy computation in the background while you draw something on screen. In a second example, I show that you can halve the time needed to fill two arrays by filling them simultaneously.
 

DonManfred

Expert
Licensed User
Longtime User
Top