B4J Question Noob questions

saboteur

New Member
Hi,

I'm thinking of using B4J to replace my current goto programming language and re-coding all my apps which are all database driven.

So i've had a play and think i've figured out most things but could do with some advice going forward.

I currently code my suite off programs as standalones, that I then call from a main menu. I then pass parameters ( username etc ) via encrypted environment variables, this enables me to keep my runtimes compact and also limits crashes to that program only ( which makes problem solving a whole heap easier :) )

So to the questions :

1. Can B4J set and get environment variables ?
2. Can I reduce my compiled runtime sizes - the demo i did of a single buttoned form comes in at 48mb ?
3. Can i utilise secure database connections to a MySQL / MaraiDB server. ?
4. Can DPI issues bite me on the a** or does B4J handle all that in the background ?

Any help or suggestions greatefully appreciated.

Saboteur
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
1. Yes,
1644940230380.png


2. I don't think so.

3. Yes, use jrdc

4. What do you mean by this? can you give an example.
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Can B4J set and get environment variables ?
yes! just call:
GetEnvironmentVariable

Can I reduce my compiled runtime sizes - the demo i did of a single buttoned form comes in at 48mb ?
No! you cant, it weights 48mb because it comes bundled with Java JDK,

You could try to do it without the bundle but it will be more difficult and you will depend on your users JDK that could be very different from yours.

Can i utilise secure database connections to a MySQL / MaraiDB server. ?
yes, JDBC drivers that are compatible with java are compatible with b4j (you dont need JRDC if the database is in the same computer)

Can DPI issues bite me on the a** or does B4J handle all that in the background ?
Not B4J but the inner technologies Java and JavaFX, there has been improvements on that front but you may need to try it. Most of the questions related to DPI on the forum has been solved successfuly
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
I think you should first take a look at the [B4X] B4XPages - Cross platform and simple framework for managing multiple pages example explanation and then look to the ThreePagesExample . A B4XPages are actually a self-stored and reusable class class which shows similarities with what your module is. The same B4XPages code can run on an Operating system like ANDROID, IOS, WINDOWS, MAC, and LINUX which have different DPI use. This is a very active forum which can help you if you have a problem.
 
Upvote 0

saboteur

New Member
Hey, thanks for the replies and info on what are probably dumb a** questions.

My ERP suite is windows only and only for internal use, so I don't see that changing in the near or long term, so B4J will fit my needs.

With regard to the package size can i not 'roll' my other programs into the one master package by simply copying over relevant programs ?

E.G I have two programs 'MENU' and 'CHOICE' so when i build a standalone package for each can i move 'CHOICE' into 'MENU' standalone thus reducing my overall package size ( as long as all the dependencies are availablein 'BIN' ) ?

Again thanks for the help.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Hey, thanks for the replies and info on what are probably dumb a** questions.
There are no dump questions, only dumb answers.
With regard to the package size can i not 'roll' my other programs into the one master package by simply copying over relevant programs ?
Both B4J stand-alone or B4J under B4X can make use of classes and code modules to create a one packet solution. Don't make the mistake that the B4J "under B4X" is a different language then B4J "stand-alone" version. A B4XPage can be seen as a class of a B4J stand-alone program that, after some minor changes in the initialization routine, can be integrated next to each other to integrate several program solutions.
With regard to the package size can i not 'roll' my other programs into the one master package by simply copying over relevant programs ?
I have no idea what you mean with relevant programs, so we cannot give a answer. But if you mean what you call a "module", yes in both cases you can split your code into different classes, code modules and use java routines yourself.
E.G I have two programs 'MENU' and 'CHOICE' so when i build a standalone package for each can i move 'CHOICE' into 'MENU' standalone thus reducing my overall package size ( as long as all the dependencies are availablein 'BIN' ) ?
As explained in a previous post, you do have some overhead. The least memory usage is to work with one program and multiple classes (=B4XPage)
 
Last edited:
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
E.G I have two programs 'MENU' and 'CHOICE' so when i build a standalone package for each can i move 'CHOICE' into 'MENU' standalone thus reducing my overall package size ( as long as all the dependencies are availablein 'BIN' ) ?
you cant do that with standalone, each project should have its own BIN folder.

BUT!

You can do that if you compile a simple jar without the packager, you just need the JDK provided on this forum, so you copy it alongside your jar file and with some command lines you should be able to open it, of course, you may need to do some research for that.

you should start here:
 
Upvote 0
Top