B4J Question Thoughts on desktop apps with b4j server + webview

Demitrius

Member
Licensed User
Hi everyone,

I'm considering b4j for cross-platform desktop apps and I want to use blazor webassembly combined with it. I want to develop the UI with blazor reusing the code of the web version and then put up a b4j server for it to work locally and respond to the http calls from blazor. I thought in develop the apps this way to be able to open them in a browser or to view them in a webview through the desktop app window so this way the user can choose how he wants to work.

One thing that can be a problem is, with this approach, we will or can have many many servers running at the same time occupying multiple ports.
What do you think? What problems or drawbacks do you envision with this method?

I believe I also have to find a way for the apps to have a mechanism to scan, when they start, in a pre-defined range of ports, for a port available for their jetty server use.
 

aeric

Expert
Licensed User
Longtime User
I'm considering b4j for cross-platform desktop apps and I want to use blazor webassembly combined with it. I want to develop the UI with blazor reusing the code of the web version and then put up a b4j server for it to work locally and respond to the http calls from blazor.
I don't get it.
blazor - C# .NET
web assembly - C/C++ , C#, ... (I don't see Java support)

How is this working together in B4J server? What you mean B4J desktop app that combine to these web server?
 
Upvote 0

Demitrius

Member
Licensed User
In practice the result of a deployed blazor web assembly app are a bunch of static files that the browser can understand so I can deploy those files to the jetty server and make it serve the spa when some client request it. I will put up an example and upload it here for you to see for yourself what I mean.
 
Upvote 0

cklester

Well-Known Member
Licensed User
I'm considering b4j for cross-platform desktop apps and I want to use blazor webassembly combined with it. I want to develop the UI with blazor reusing the code of the web version and then put up a b4j server for it to work locally and respond to the http calls from blazor. I thought in develop the apps this way to be able to open them in a browser or to view them in a webview through the desktop app window so this way the user can choose how he wants to work.

Whoa. I wonder if this has been considered or done before. Create "web" apps that are actually served from a server on your own PC (via localhost?). At first glance, this seems like a very compelling idea!
 
Upvote 0

Demitrius

Member
Licensed User
Off-topic.: Do you know the upload size limit for attached files? I have the example ready but I can't upload it due to its size (8mb)
 
Upvote 0

Demitrius

Member
Licensed User
Upvote 0

Demitrius

Member
Licensed User
I get the concept now but I don't like it. It is bloated and big in file size. It is more for personal taste or if you are more familiar with C#.
Do you know of a similar concept (web technologies for desktop applications) less bloated with less file size?
 
Upvote 0

Demitrius

Member
Licensed User
"Bloat" is irrelevant these days. Don't worry about disk space or RAM usage.
Thanks! I get @aeric 's concerns. I'm also not very fond of bloated systems myself but I easily trade disk space for ease of development cause disk space is cheaper than time wasted. When it comes to RAM and CPU it's not the same story because it limits the user of having multiple apps running and performant at the same time.
 
Upvote 0

Demitrius

Member
Licensed User
PWA?
I still prefer native UI app for desktop. It is easier to develop B4XPages app with B4X that connect to database using jrdc or rest API.
I get it but B4XPages it's not native UI either. It would be if it could use SwiftUI for mac OS, WinUI for windows and so forth, which I believe (correct me if I'm wrong) it's not the case. But at the end of the day it's all about solving problems with the things that makes us more productive ;)
 
Upvote 0

rraswisak

Active Member
Licensed User
Interesting...

I run the sample in post #7, it run as expected but when I do some counter function and refresh the page, Error 404Not Found show up, have you solve it and what the causing the error
 
Upvote 0
Top