B4J Tutorial B4J and Raspberry Pi boards

Discussion in 'B4J Tutorials' started by Erel, Jan 23, 2014.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Edit: UI apps are no longer supported on Raspberry Pi. Non-ui apps work great and you can show an interface through the browser by implementing a web server.
    The first step is to download and run B4J-Bridge: Remote debugging with B4J-Bridge

    Raspberry Pi is a low-cost Linux board:


    B4J v1.50 adds support for these boards.

    Here are two screenshots:


    Moving smiley:

    Out of the box the default OS includes Java 7. However it doesn't include JavaFX libraries.
    Non-UI applications will work with this version.

    If you want to run UI applications then you need to install Java 8: https://jdk8.java.net/download.html
    You need to download Linux ARMv6/7 VFP, HardFP ABI.
    Copy it to the board and unpack it. There is no installation step. You should use the full path from the terminal.

    For example:
    /<path to jdk1.8>/jre/bin/java -jar DBUtils.jar
    UI apps will run in a full screen mode. You cannot resize the window and there is no close button. Be sure to include one in your program. You can also kill it through SSH:
    ps -A|grep java
    kill <pid>
    You will probably need to add more memory to the video card in the board settings, otherwise you will see all kinds of OpenGL errors.

    The performance is quite bad. Especially the loading time. However it is usable.

    I was a bit surprised to see that even the SQLite driver worked on the first time.

    WebView and HtmlEditor nodes are not supported. MediaPlayer is also not supported.

    You can also run server applications on these boards: http://www.basic4ppc.com/android/forum/threads/server-building-web-servers-with-b4j.37172/
    Last edited: Nov 16, 2015
  2. Theera

    Theera Well-Known Member Licensed User

    Can we change fonts by using linuxmint's fonts? (I need to be sure,it can use Thai fonts too)
  3. Erel

    Erel Administrator Staff Member Licensed User

    I haven't tried it. Though I expect it to work.
  4. engvidal

    engvidal Member Licensed User


    Anyone tried it with beaglebone black ??
  5. JakeBullet70

    JakeBullet70 Well-Known Member Licensed User

    Is the program running from the command line or from the GUI?
  6. Erel

    Erel Administrator Staff Member Licensed User

    I ran it from the command line. You can probably create a shortcut and run it from the GUI.
    Theera likes this.
  7. JakeBullet70

    JakeBullet70 Well-Known Member Licensed User

    I am wondering if it needs the GUI or if it is providing its own graphic layer.
    I mean, what if the GUI - desktop is not installed?
  8. Erel

    Erel Administrator Staff Member Licensed User

    I haven't tested if, however I believe that it will work without the GUI desktop. It runs in a full screen mode that is not related to the desktop.
  9. salim safran

    salim safran Member Licensed User

    very promising updates, will get one PI today and check it out, also will order OlinuXino and BBB, it is very exciting progress.
    thank you.
  10. JakeBullet70

    JakeBullet70 Well-Known Member Licensed User

    Has anyone looked into the JavaFX slow startup?
    I found this here as others have complained about it.
    I do not have a PI yet and am still debating on buying one .
  11. Erel

    Erel Administrator Staff Member Licensed User

    I guess that you are asking about slow startup on Raspberry Pis. JavaFX apps are not slow on other platforms.

    The link you posted is not related to these boards.
  12. udg

    udg Well-Known Member Licensed User

    Hi all,

    I'd like to give a try to this Rasperry stuff, so can you advice on what I should buy?
    Its main use will be that of a B4J server visible to outside world to test websockets-based apps both web-based and B4A based.

    I guess that I need as a minimum a Rev. B board (which OS?) and a power supply, but there are a few cheap options that sound promising to extend the board usability (SDHC card, 150Mbps wireless adapter, a case..).

    So, what is your advice?

  13. Erel

    Erel Administrator Staff Member Licensed User

    HDMI cable with DVI connector so you will be able to connect the device directly to a monitor.
  14. udg

    udg Well-Known Member Licensed User

    Thanks Erel,

    I did forget to mention the cable..

    Which OS would you recommend?
    Any preference to an SDHC card size? The larger the better?

    Is this a device we can leave on H24 or eventually should we worry about temperature issues or low-grade electronics?
    Maybe I should ask that to the manufacturer, but here I'm just curious about your hands-on experience and feeling with the board.

  15. MaFu

    MaFu Well-Known Member Licensed User

    Use the current Raspbian image from the Pi download site, it's the best solution except you would use it as media machine only.
    And many use the Pi as 24/7 server, so no worries about heating.
  16. udg

    udg Well-Known Member Licensed User

    Thank you, Manfred.
    Can't wait for my already issued order to be delivered...
    Last edited: Dec 30, 2014
  17. jcredk

    jcredk Member Licensed User

    Hi all,
    I am getting here from the 1st B4J page (http://www.b4x.com/b4j.html). But I was not able to find a post explaining with more detail how to setup the environment to implement applications for Pi.
    Did I miss a link please?

    PS: my Pi is the B+ version with Raspbian
  18. Michael1968

    Michael1968 Member Licensed User

    hi jcedk,

    search for raspberry pi or ...debugging b4j-bridge

    there are very,very helpful tutorial's from Robert Linn : www.rwblinn.de

    best regards
    Mark Turney likes this.
  19. jcredk

    jcredk Member Licensed User

    Hi Michael,
    According to your login name we are probably born on the same year!
    I had a look to the url you gave: it seems very promising ...
    I will dig there until I have new questions ... or not.

    Thanks, and happy new year to all ... a bit in advance!
  20. Mark Turney

    Mark Turney Active Member Licensed User

Share This Page