B4x rant thread

This does not work, as I mentioned in my step-by-step post. I just tried it again on another Windows 10 computer to make sure it wasn’t an issue with my VM. The only option I found that produced the compiled jar file is to run “Build Standalone Package” on Windows.

Update:
So I tried to move the exe somewhere else and it wouldn’t run. Then I moved the entire build folder somewhere else and it ran. The build folder is about 48 MBs on my machine. Not sure if all the folders/files therein are needed or not.

You did compile in Release mode? That is when the .jar is generated in the Objects folder on Windows

image

1 Like

Ah, that’s it. Thanks.

Again, as I stated in my step-by-step post, there’s not a complete and working procedure anywhere that I could find. This is one more detail to add.

Edit: This creates the jar file, but not the json file. If you’re going to build the Mac package from Terminal, you’ll need this (or just create it - format is included in my post above). If you are going to use the remote-debug method that Erel laid out, then you don’t need the json file.

mine did create the json file next to the jar file but what is inside is the path for the windows machine.

Couple of weeks dabbling with B4A and in some areas Im impressed.
But currently I think Im running into possible memory issues under Android. I have a couple of million element int arrays which represent something like a map, and when that ‘map’ is fully populated the tablet slows to a crawl / doesn’t refresh the screen
Working on optimising it but I have feeling it may not scale as I would like.
This isnt a rant, and may be due to inexperience.

any way you can trim that data set down ?

ie/ if its a map can you have enough data to show just that portion at some zoom level

like google maps does where if you are zoomed wya out it shows you only features that would be viewable at whatever level and as you zoom in smaller & smaller details are shown but still only in that viewable area ?
then if you scroll the map the details for the new viewable area are fetched ?

Yeah, I do that already.
It doesn’t seem to be the drawing so much as the iteration through the array to decide if it should be drawn.
I can optimise some of it by turning a 2 dimensional array into a long one dimensional array, and pre-calc the index by multiplying the x co-ordinate by the width, then adding the y.

I just noticed that byte is a variable type - Im currently using int
Sadly, byte is signed and I need unsigned, but if I switch to byte storage , and upscale to short for access, I can reduce the footprint by 75% Hmmm.

a million ints is 4 million bytes roughly
that doesnt seem like it should be an issue
BUT is this compiled into a native EXE or running in a JRE of some kind ?
maybe there’s a limit to how much memory that runtime is permitted to use ? (@Erel could correct me here as this is just a wild assed guess as to what might be impacting you)
Is it possible the device has limited memory available to the CPU and that causes issues once you exceed that ?

Just tossing out ideas here

I am so excited to have found B4X due to a comment on this forum. I’m only a little bit into it so far, dabbling in some of the tutorials, but it looks amazing. Their GUI designer alone is worth the price of admission. Xojo could really learn something from the B4X development team… which, I’m not sure about, but is Erel the only one on it?

I’m also starting to port some of my company’s internal apps to B4J. It’s been easy so far, although I haven’t built any executables yet. It doesn’t look complicated, but we’ll see how that goes probably next week.

I didn’t realize it wasn’t using native controls, but it looks just fine so far. Initially, the Java-base made me nervous, but I’ve gotten past it. I don’t think anyone will care, so long as the apps work well.

Like I said, I’m excited to be exploring this ecosystem. From what I’ve seen so far, including the tutorial videos and their forum, it’s lookin’ like sunshine ahead. :wink:

5 Likes

I have not tested it (I’m more into Web development in B4J these days), but on Windows you can have a Metro-UI look style it appears. See https://www.b4x.com/android/forum/threads/quick-metro-look-for-your-b4j-apps.98994/

image

B4A performance and limits are the same as native Android apps that are developed with Android Studio.
There is no JRE and it is not an EXE file. Android packages are called APKs.

The OS limits the memory per process based on all kinds of factors.
I’ve just tried to create a 10 million ints array:

Dim LargeArray(10 * 1000000) As Int
Log(LargeArray.Length)

It works when I test it.

Note that performance should always be tested in release mode. Debug mode can be much slower.

2 Likes

Thanks for the clarification.

just a quick question. i am try to install b4j on my windows 8 machine. install the jdk11.0.1 and also b4j.exe. setup the path for javax and start a simple project with 2 button.

when i do a “compile and run” i got this error
“error: cannot read file C:\JAVA\jdk-11.0.1\bin…\javafx\lib._javafx-swt.jar”

what did i do wrong??
i manage to get it working on windows 10 without problem.

:exploding_head: You are the second person I know with Windows 8

Using windows 8

1 Like

just upgrade to window 10 home and still does not work.
got the same error

what else can i do???

whose jdk did you install ?
the one from oracle ? or from another vendor like azul ?

I grabbed the azul jfx sdk (which is java + javafx) installed it and off things went once I configured the paths
HOWEVER I grabbed Java 15 and it seems to build a standalone B4J requires, or insists on, Java 11 so I might need a different installer from Azul

I got the one recommended on the B4J
website

I had tried that last night as well and could not get anything to run
@thorstenstueker recommended grabbing the installed from Azul, another JDK provider, and I used that and away things went
It seems oracle split JFX into its own open source project
There used to be an installer for that JDK but there isnt one now - but there is with Azul (maybe others as well) which simplifies things

EDIT : This is the one I grabbed


its the entire JDK + JFX in one download

Follow the links from the installation page: https://www.b4x.com/b4j.html
Best to use OpenJDK 11 or 14. It must be downloaded from b4x.com as B4J expects a specific structure.

1 Like