B4J Question Help Reqruied : Raspberry Pi - UI Apps

paragkini

Member
Licensed User
Longtime User
Hi,
Need help in running UI apps on Raspberry Pi.

My obvious option was one thread where
"Erel said:
You can use Java 7 or Java 8u6 to run UI apps. The layout will not be perfect but it should work."
Have read many threads on this and did exactly the same. (given all the links at the bottom and texts).

After two three road blocks and re-flashing the OS, got everything installed (Java 8 and JFX).
So when I run my UI app, I don't get any error anymore.

Problem: My app runs without error but nothing shows on the screen. There is no error on the command prompt or B4J logs (if run from there, both debug and release mode.)

Can some help me running UI app. (My objective of buying RPi was to run this app for my kids' studies. Tried running it with "sudo" access also.

My versions:
jdk-8u60-linux-arm32-vfp-hflt.tar.gz
openjfx-8u40-sdk-overlay-linux-armv6hf.zip


Steps followed: (versions will differ, my versions given above)

Step 1: Download http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-arm32-vfp-hflt.gz (http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-arm32-vfp-hflt.gz)
Step 2: sudo tar zxvf jdk-8u73-linux-arm32-vfp-hflt.tar.gz -C /opt ->installs in /opt
Step3: sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_73/bin/javac 1
Step4 :sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 1
Step5: sudo update-alternatives --config javac
Step6: sudo update-alternatives --config java
Step7: download http://108.61.191.178/downloads/openjfx-8u40-sdk-overlay-linux-armv6hf.zip (http://108.61.191.178/downloads/openjfx-8u40-sdk-overlay-linux-armv6hf.zip)
Step8: sudo unzip openjfx-8u40-sdk-overlay-linux-armv6hf.zip -d /opt/jdk1.8.0_73


Links followed:

https://www.b4x.com/android/forum/t...on-on-raspberry-pi-help-needed.63403/#content
https://www.b4x.com/android/forum/t...-i-run-ui-apps-on-it.62704/reply?quote=395986
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/RaspberryPiFX/raspberryfx.html
https://www.b4x.com/android/forum/t...b4j-from-the-scratch.59784/reply?quote=381603
https://www.b4x.com/android/forum/threads/iot-linux-embedded-boards-gettings-started.60430/#content
http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javaseembedded8u6-2406243.html
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
 

paragkini

Member
Licensed User
Longtime User
Raspberry Pi 3 Model B.
But I want to use B4J.
Had difficult time to spare from daily schedule for this B4J app, even more difficult to move to B4A right now...
(The app idea that I have will involve all B4J, B4A and Arduino) but as of now first step is this B4J app.
 
Upvote 0

paragkini

Member
Licensed User
Longtime User
Ok. So I have 8u60... Do I need other version?
And what about JFX? I have 8u40... Is that a problem in this case???
 
Last edited:
Upvote 0

paragkini

Member
Licensed User
Longtime User
Sorry, but my understanding then is that my versions will work, (Java 8u60 / JFX 8u40) but they are not...
Am I missing something? (I suppose no...)
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
What OS is on your PC, Linux?
What OS is on the RPi?
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
I assume you have created an UI-App? That means you are loading a layout or creating one with code.

Maybe you could upload the first part of your app (incl. Sub AppStart) or the whole thing as ZIp file.
 
Last edited:
Upvote 0

paragkini

Member
Licensed User
Longtime User
Hi

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form

    Public dbQNA As SQL
    Private rsTemp As ResultSet
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   
    MainForm = Form1
    MainForm.RootPane.LoadLayout("frmMain") 'Load the layout file.
    MainForm.Show
End Sub

Also created layout file. When I am running on PC, everything is fine. Pls let me know if complete project needs to be uploaded.
 
Upvote 0

paragkini

Member
Licensed User
Longtime User
Hi, my code attached.

[Tried uploading compiled jar but its 3MB so can't]
 

Attachments

  • Code.zip
    14 KB · Views: 323
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Sorry but I cannot test your app at present. My SD card is too small to install the fx update.
 
Upvote 0

paragkini

Member
Licensed User
Longtime User
Can some else share their SD card image where java UI apps working? I will put same SD image on my card and see if it works.... I really need help on this...
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
Hi

Your code is working normally. The only problem is the screen resolution, because I use 7 "screen, I can not see the whole screen. You will probably use some bigger screen.

Image of the system is too large to send, size is almost 2Gb.

I'm on my raspberries using conventional Raspbian (latest), I added to the system:

2.1.4. Embedded
  1. The latest version of JDK 8 installed on your embedded device, available from http://www.oracle.com/technetwork/java/javase/downloads/index.html

  2. The latest version of the JavaFX Embedded SDK port, available from http://gluonhq.com/open-source/javafxports/downloads. Unzip the downloaded JavaFX Embedded SDK and copy the following files into the JDK 8 installation directory:


http://docs.gluonhq.com/javafxports/

B4X:
pi@raspberrypi:~/b4j/Objects $ sudo /home/pi/b4j/jdk1.8.0_122/jre/bin/java -jar result.jar

I hope that helped ..
 
Upvote 0
Top