B4J Tutorial [WebApp] Web Apps Overview

Status
Not open for further replies.

bluedude

Well-Known Member
Licensed User
Longtime 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

B4X founder
Staff member
Licensed User
Longtime 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:

Douglas Farias

Expert
Licensed User
Longtime User
erel the examples run only at vps?
i have a websitehost and i put this on but give erros
here is the link
http://likeapps.net/chat/

i need a vps to work the examples?
 

LucaMs

Expert
Licensed User
Longtime 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

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

Erel

B4X founder
Staff member
Licensed User
Longtime 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
Longtime User


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

Since I'm awake now as a mummy , 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
Longtime 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.
 

Baltazar

Member
Licensed User
Longtime 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
Longtime 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
Longtime 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
Longtime User
Last edited:

Baltazar

Member
Licensed User
Longtime 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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…