B4J Tutorial [WebApp] Web Apps Overview

Status
Not open for further replies.

Erel

Administrator
Staff member
Licensed User
The server projects were updated. The update fixes an issue with repetitive push messages. The projects require B4J v2.20+.
 

bluedude

Well-Known Member
Licensed User
I definitely think we need a few guides to set it up on VPS systems. I run a CentOS VPS but have no clue how to configure and use this :)

WebSockets would solve a shitload of issues with GCM (sometimes slow).

Anyone?
 

Erel

Administrator
Staff member
Licensed User
WebSockets would solve a shitload of issues with GCM (sometimes slow).
How are WebSockets related to GCM?
sorry I misread your sentence.

Start a new thread for the deployment question. As written in the tutorial the WebApp jar is a regular executable java jar. You just need to install Java and run it.
 
Last edited:

LucaMs

Expert
Licensed User
This tutorial was written before WebSockets were available.
This phrase makes me think that in any case it is best to use this new opportunity.

All this is unclear to me, I will have to read again and better, but maybe these WebSocket-WebApp are not needed in my case, for which I should probably use a non-UI server, right?

Also because I fight with html-javascript-jquery ... I prefer the Chinese :D

(I'm referring to that sort of poker for mobile)
 

Erel

Administrator
Staff member
Licensed User
I will have to read again and better, but maybe these WebSocket-WebApp are not needed in my case, for which I should probably use a non-UI server, right?
It really depends on your requirements. WebSockets should mostly be used when you need to create a rich user interface (or if a push / continuous connection is required). If you want to build an API for other applications then WebSockets are less useful.
 

LucaMs

Expert
Licensed User
It really depends on your requirements. WebSockets should mostly be used when you need to create a rich user interface (or if a push / continuous connection is required). If you want to build an API for other applications then WebSockets are less useful.

I need to study ;)


Many thanks
 

LucaMs

Expert
Licensed User
It really depends on your requirements. WebSockets should mostly be used when you need to create a rich user interface (or if a push / continuous connection is required). If you want to build an API for other applications then WebSockets are less useful.

API - Who knows how many API I used ... but how to create it for my purpose?

Since I'm awake now as a mummy :confused:, I do (perhaps again) an elementary example:

many poker tables "connected" to the server;
a player raises x$;

I guess I have to make a call similar to this from your example "Upload files from your app to your B4J B4A server over the internet":
B4X:
Private Sub btnSendMessage_Click
    Dim j As HttpJob
    j.Initialize("msg", Me)
    j.PostString(ServerLink & "?type=text", txtMessage.Text)
    mPhone.HideKeyboard(Activity)
End Sub
replacing the txtMessage.Text with some text-command,
and then manage everything on server through those "Handler" (classes).

But most likely there is a better method, since in this way everything seems to me very fragmented.


[P.S. this may seem off-topic, but I also wonder if you should use these WebSockets somehow]
 

Baltazar

Member
Licensed User
where do i find all the needed libraries for the examples?

It would be great if you can set links to the needed libraries in first post.

Actually i´m searching for (and did not find them actually):
SecureRandom, MessageDigest, ByteConverter
In relation to this animal SecureRandom , I can't run Erel's ServerExample. I searched both B4A & B4J forums but can't get any clue as to which is the culprit why I'm having this Error. Note that I have checked all the libraries but to no avail.
scrn.png
 

Baltazar

Member
Licensed User
Thanks. It resolved the issue but now it says "Unknown Member -- ws.RunFunction("Pong", Null)" in the PushB4A module. I probably need to update my libraries.
 

billzhan

Active Member
Licensed User
I think the last lib (websocket(v1.01)) in you picture is a B4A only lib,it has a member with same name 'WebSocket' as B4J server lib . Remove it.

Please make sure that you are using B4J 2.20 and java 1.7+
 

Baltazar

Member
Licensed User
Thanks. There is a progress indeed. I have managed to compile it and dumped all the www folder contents in my Apache document host folder. I can view the default (index.html) page on any of my device connected to my Apache server; it shows the selection (menu) but some elements are missing like the excel table, the bouncing smiley etc.
 

billzhan

Active Member
Licensed User
Last edited:

Baltazar

Member
Licensed User
I see. My purpose of running it in a real server is part of my requirements in the academe :). Some advanced studies , sort of. I have tried the simpler demo , yest it did work. Thanks again.
 
Status
Not open for further replies.
Top