B4J Tutorial [WebApp] Web Apps Overview

Discussion in 'B4J Tutorials' started by Erel, Apr 10, 2014.

Thread Status:
Not open for further replies.
  1. jl888

    jl888 New Member Licensed User

    Thank you Erel.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Erel

    Erel Administrator Staff Member Licensed User

  4. Erel

    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+.
     
  5. bluedude

    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?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    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: May 14, 2014
  7. Douglas Farias

    Douglas Farias Expert Licensed 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?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Yes. A VPS is usually required.
     
    Douglas Farias likes this.
  9. LucaMs

    LucaMs Expert Licensed User

    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)
     
  10. Erel

    Erel Administrator Staff Member 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.
     
  11. LucaMs

    LucaMs Expert Licensed User


    I need to study ;)


    Many thanks
     
  12. LucaMs

    LucaMs Expert Licensed 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 :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":
    Code:
    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]
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this discussion.
     
  14. Baltazar

    Baltazar Member Licensed User

    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
     
  15. billzhan

    billzhan Active Member Licensed User

  16. Baltazar

    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.
     
  17. billzhan

    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+
     
  18. Baltazar

    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.
     
  19. billzhan

    billzhan Active Member Licensed User

    Last edited: Oct 1, 2014
  20. Baltazar

    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.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice