# Another Forum area for B4X?

**URL:** <https://ifnotnil.com/t/another-forum-area-for-b4x/968>\
**Category:** Other\
**Created:** [10 September 2020 11:00 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968 "2020-09-10T11:00:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffT](https://ifnotnil.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JeffT](https://ifnotnil.com/u/JeffT)\
**Post date:** [10 September 2020 11:00 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/1 "2020-09-10T11:00:52Z")

</div>

I know most of the discussion here is Xojo related, but I do wonder if we might benefit by actively discussing B4X, with a new category.

I’m in the early stages and would quite like a place to discuss CURRENT good practice and tips.

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [10 September 2020 11:11 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/2 "2020-09-10T11:11:29Z")

</div>

Mixed feelings. I kind of like the idea of having a forum discussing _solutions_ (which may start with one tool, but may or may not end with another because of a better solution).

B4X does not really need a separate forum, as Erel from the official B4X forum does not act like the moderators on the official Xojo forum do (and I thought this was the main reason for this forum, being allowed to discuss everything, without the risk of being banned or posts deleted?).

Erel is even a member here.

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [10 September 2020 11:21 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/3 "2020-09-10T11:21:02Z")

</div>

Even a bit afraid this would lead to a Xojo vs B4X vs XYZ battle. As it is now, we are all cross platform devs (tool independent).

---

<div class="post-metadata">

**Author:** ![Emile](https://ifnotnil.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@Emile](https://ifnotnil.com/u/Emile)\
**Post date:** [10 September 2020 11:42 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/4 "2020-09-10T11:42:16Z")

</div>

> As it is now, we are all cross platform devs (tool independent).  
> I love this sentence !

Back to OPQ:  
This is an idea: how to start using B4X and more (with time) for those who want to move.

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [10 September 2020 11:54 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/5 "2020-09-10T11:54:39Z")

</div>

> [@Emile](#):
>
> how to start using B4X and more (with time) for those who want to move.

Do you mean like some kind of ’ _I Wish I Knew How to… move to B4X_’ book? If so, we do have probably the best book writer aboard this forum @eugenedakin 😇

I stick to my earlier position however: the point of this forum shouldn’t be that. All platforms equal and all have a right to exist. No need to push someone one direction or another.

---

<div class="post-metadata">

**Author:** ![ivan](https://ifnotnil.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://ifnotnil.com/u/ivan)\
**Post date:** [10 September 2020 13:52 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/6 "2020-09-10T13:52:09Z")

</div>

Not a fan of the idea, B4X forum is great, most of the tutorials have a Note at the top if they are deprecated with a link to the CURRENT good practice.

You just have to use to the search function of the forum

---

<div class="post-metadata">

**Author:** ![HalGumbert](https://ifnotnil.com/user_avatar/ifnotnil.com/halgumbert/32/2198_2.png) [@HalGumbert](https://ifnotnil.com/u/HalGumbert)\
**Post date:** [10 September 2020 14:26 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/7 "2020-09-10T14:26:53Z")

</div>

I think having a B4X area is a good idea. I’d also like a PHP area. Don’t worry about code wars.

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [10 September 2020 15:27 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/8 "2020-09-10T15:27:03Z")

</div>

that all runs the risk of segmenting the population of this forum

---

<div class="post-metadata">

**Author:** ![eugenedakin](https://ifnotnil.com/user_avatar/ifnotnil.com/eugenedakin/32/3892_2.png) [@eugenedakin](https://ifnotnil.com/u/eugenedakin)\
**Post date:** [10 September 2020 16:33 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/9 "2020-09-10T16:33:56Z")

</div>

Thanks for the kind words.

Writing a book on B4X is a strong possibility, and I have a few basic questions, and pardon my naive questions

1. does B4X have the ability to do multicore multiprocessing? Xojo can’t do this and my desktop programs are becoming painfully slow.
2. you are great at graphics, and can B4X do high performance graphics for games and/or virtual reality? Again, Xojo can’t do this and I have a few clients who want this graphical option.
3. does B4X support graphic languages such as DirectX and Vulkan?
4. I am guessing that B4X likely supports all the common databases right? (Postgresql, sqlite, etc)
5. does B4X support cameras on Windows? I could only find legacy support for cameras with Xojo on Windows.
6. can an exe be created by B4X so that my app can be portable and sold on Microsoft store?
7. I am a Raspberry pi fanatic, and I am guessing that B4X supports I/O for the Raspberry OS with electronics?

I greatly appreciate your thoughts. 🙂

---

<div class="post-metadata">

**Author:** ![JeffT](https://ifnotnil.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JeffT](https://ifnotnil.com/u/JeffT)\
**Post date:** [10 September 2020 16:51 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/10 "2020-09-10T16:51:20Z")

</div>

from the b4x site  
“JavaFX uses hardware acceleration automatically if the display driver is supported. There is no simple way to use OpenGL or DirectX with JavaFX (and B4J). It might be better supported once JavaFX 8.0 is released.” (this from 2014)

’ JDBCSQL Connector/J - Connect directly to MySQL, MSSQL, PostgreSQL, MariaDB and Oracle databases’  
link: [https://www.b4x.com/android/forum/threads/jdbcsql-connector-j-connect-directly-to-mysql-mssql-postgresql-mariadb-and-oracle-databases.107545/](https://www.b4x.com/android/forum/threads/jdbcsql-connector-j-connect-directly-to-mysql-mssql-postgresql-mariadb-and-oracle-databases.107545/)

Camera:  
[iMedia library v1.10](http://www.b4x.com/android/forum/threads/updates-to-internal-libraries.48179/#post-302797) includes a new type of object named LLCamera. LLCamera provides low level camera access, similar to B4A Camera library. If you just want to allow the user to take a picture then it will probably be better to use Camera instead of LLCamera.

Exectuable:

'When you compile in Release mode the complete app is packed as an executable jar file.

You can distribute this jar file and run it on Windows, Mac or Linux.

However there are cases where you want to convert this jar file to a native executable. For example if you want to set a custom icon.

You can use a free tool named Launch4j to convert the jar file to a native Windows executable.

PI outputs:

> **[B4J Library - \[IoT\] jPi4J - Raspberry Pi GPIO controller](https://www.b4x.com/android/forum/threads/iot-jpi4j-raspberry-pi-gpio-controller.37493/)**
>
> This is a wrapper for Pi4J library.
> It allows you are control the Raspberry Pi board GPIO pins.
> 
> Using this library is quite simple. You can use it from a UI app or non-UI app.
> 
> First you should initialize a GpioController object.
> The second step is...

---

<div class="post-metadata">

**Author:** ![Erel](https://ifnotnil.com/letter_avatar_proxy/v4/letter/e/ecccb3/32.png) [@Erel](https://ifnotnil.com/u/Erel)\
**Post date:** [10 September 2020 18:05 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/11 "2020-09-10T18:05:58Z")

</div>

1. Many things in B4X (not talking about B4R here) are executed in the background with background threads. With the exception of server solutions, the B4X code always runs on the main thread. Libraries can easily run tasks on background threads, there is a built-in thread pool in the framework.  
Stuff like communication, database operations, file operations and others include async APIs.

It is not exactly related but it is very important for B4X developers to become familiar with resumable subs.  
It allows developers to run async code in almost the same way you run regular synchronous code.  
For example:

```auto
HttpJob.Download(link)
Wait For JobDone 'not the exact syntax
'Work with result
```

Overall the performance of B4X is very good. Tip: never test performance in debug mode. It will be much slower.

1. Not really. You can create 2d games with XUI2D: [https://www.b4x.com/android/forum/threads/96454/#content](https://www.b4x.com/android/forum/threads/96454/#content)
2. No.
3. True.
4. B4A and B4i can of course do many things with the cameras. It is quite simple to access native libraries (Java in the case of B4J) so if you find a Java library for this, it will not be too complicated to use it from B4J. A quick search revealed this library: [https://www.b4x.com/android/forum/threads/class-webcam-capture.53211/#content](https://www.b4x.com/android/forum/threads/class-webcam-capture.53211/#content)  
I never tried it myself.
5. Creating a standalone executable with B4J, is very simple. Don’t use the old Launch4j tool. Use the built-in packager: [https://www.b4x.com/android/forum/threads/integrated-b4jpackager11-the-simple-way-to-distribute-standalone-ui-apps.117880/#content](https://www.b4x.com/android/forum/threads/integrated-b4jpackager11-the-simple-way-to-distribute-standalone-ui-apps.117880/#content)  
The result package size will be about 35mb without WebView or 50mb with it. The size comes from the embedded JRE.  
Note that the sizes of B4i IPA or B4A APK are very small. The framework will add about 400kb.
6. Yes. Search for Pi4J.

---

<div class="post-metadata">

**Author:** ![eugenedakin](https://ifnotnil.com/user_avatar/ifnotnil.com/eugenedakin/32/3892_2.png) [@eugenedakin](https://ifnotnil.com/u/eugenedakin)\
**Post date:** [11 September 2020 00:16 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/12 "2020-09-11T00:16:17Z")

</div>

Thanks for the great and informative response Erel! 🙂

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [11 September 2020 04:31 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/13 "2020-09-11T04:31:08Z")

</div>

As for the the Vulkan/DirectX question, maybe this lib could be wrapped for B4X: [https://www.lwjgl.org/](https://www.lwjgl.org/)

---

<div class="post-metadata">

**Author:** ![minihold](https://ifnotnil.com/user_avatar/ifnotnil.com/minihold/32/1477_2.png) [@minihold](https://ifnotnil.com/u/minihold)\
**Post date:** [11 September 2020 06:15 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/14 "2020-09-11T06:15:52Z")

</div>

👍

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [11 September 2020 06:20 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/15 "2020-09-11T06:20:48Z")

</div>

Just did a quick proof of concept and I think the LWJGL lib would be doable to wrap. It would take a typing enthusiastic to write the wrap methods, but not difficult at all. 😃

@eugenedakin This code will probably make sense to you, but as I don’t know OpenGL I just translated an existing demo.

I guess the same would be possible to do for Vulkan, and this lib does support that.

 ![GLB4X](https://ifnotnil.com/uploads/default/original/1X/08725c9673cbee1c7875bd6e14f02b5611da1a81.jpeg)

---

<div class="post-metadata">

**Author:** ![eugenedakin](https://ifnotnil.com/user_avatar/ifnotnil.com/eugenedakin/32/3892_2.png) [@eugenedakin](https://ifnotnil.com/u/eugenedakin)\
**Post date:** [11 September 2020 10:10 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/16 "2020-09-11T10:10:11Z")

</div>

> [@Alwaysbusy](#):
>
> [eugenedakin](https://ifnotnil.com/u/eugenedakin) This code will probably make sense to you, but as I don’t know OpenGL I just translated an existing demo.

Thank you for the demo.

Yes this makes alot of sense. I am honestly amazed at how many open and free libraries there are for Java/B4X (etc). Since the library (or even part of a library) exists for vulkan/OpenGL, the this is very doable in B4X.

I was contemplating writing a wrapper for Vulkan in Xojo, but the work involved was large. Xojo’s graphical performance is poor (at best), and unstable on Windows - crashing, memory issues, etc. Lol, of course I found this out the hard way when I wrote the OpenGL book for Xojo.

Writing a wrapper isn’t that hard (like the one I did for pigpio on the Raspberry Pi) wasn’t that hard, it just required time and a very organized plan, along with example documentation to make it practical in the real world.

The stumbling block that I keep running into with Xojo is poor performance on Windows, and every other language I tried (C++, C, C #, even Visual Basic) were all perfectly fine for performance. Admittantly, I have not tried Java yet and you have piqued my interest.

Alain and Erel, thanks for your helpful answers to my questions. I am going to give B4X some serious thought for my next project and/or book.

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [11 September 2020 10:14 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/17 "2020-09-11T10:14:26Z")

</div>

> [@eugenedakin](#):
>
> Admittantly, I have not tried Java yet and you have piqued my interest

Just contact me if you need help with getting started wrapping this (or another) lib for B4X. I can provide you with a starting project in Eclipse and then you can add as you see needed.

---

<div class="post-metadata">

**Author:** ![eugenedakin](https://ifnotnil.com/user_avatar/ifnotnil.com/eugenedakin/32/3892_2.png) [@eugenedakin](https://ifnotnil.com/u/eugenedakin)\
**Post date:** [11 September 2020 11:02 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/18 "2020-09-11T11:02:38Z")

</div>

> [@Alwaysbusy](#):
>
> Do you mean like some kind of ’ _I Wish I Knew How to… move to B4X_ ’ book? If so, we do have probably the best book writer aboard this forum @eugenedakin 😇

Just for fun, I counted up the number of books that I wrote, and there were a total of 33 books published, with the largest book being Windows API declares at over 1,000 pages. Some of the books have been retired. Chuckle, I wouldn’t say that I am the best book writer, but I likely fit into the category of the most-books written. Time flies when your having fun 🙂

---

<div class="post-metadata">

**Author:** ![Alwaysbusy](https://ifnotnil.com/user_avatar/ifnotnil.com/alwaysbusy/32/894_2.png) [@Alwaysbusy](https://ifnotnil.com/u/Alwaysbusy)\
**Post date:** [11 September 2020 11:10 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/19 "2020-09-11T11:10:07Z")

</div>

Quite the achievement!

---

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [12 September 2020 17:41 UTC](https://ifnotnil.com/t/another-forum-area-for-b4x/968/20 "2020-09-12T17:41:03Z")

</div>

I agree. Since most people here use or used Xojo, a guide to transitioning from Xojo to B4J and B4i would be great. Things like displaying windows (does it use implicit instances?), modal windows, custom messagebox with return value(s), global variables (gotchas, best practice), creating classes and subclassing existing classes and controls, etc.

[Next page](https://ifnotnil.com/t/another-forum-area-for-b4x/968.md?page=2)
