B4J Tutorial [WebApp] Web Apps Overview

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

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

    jcredk Member Licensed User

    Hi all,
    I am working on a project to make Android devices push messages to each other (not chaos, with a logic behind). This server apps seems a great starting point.
    Let's assume that my ADSL box is having a DNS ("MyDNS"), and the raspberry pi having a fix local ip adress ("PiIP")

    If I want to run the server of this tutorial, could you tell me how I should setup the ADSL port forwarding to "expose" the Pi to the web please ?

    Thanks,
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Roberto P.

    Roberto P. Well-Known Member Licensed User

    I was able to install and run the sample. Is there a way to launch the server without displaying the console dos?
    Or is there a way to launch the server as a service?

    upload_2015-2-13_14-33-7.png


    here's how to launch the application: "C: \ Program Files (x86) \ Java \ jre7 \ bin \ java" -jar MetaDataSyncServer.jar

    thanks
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  5. iCAB

    iCAB Well-Known Member Licensed User

    Hi Erel

    I am trying to work with the examples attached:
    ServerExampleNoMySQL.zip, gives me a compile error when I try to "Compile to library" (
    Error description: Cannot access excluded module: main
    Occurred on line: 15
    resp.SendRedirect(req.FullRequestURI.Replace("http:", "https:") _
    .Replace(Main.srvr.Port, Main.srvr.SslPort)))



    Thank you
     
    Last edited: Jun 24, 2015
  6. Erel

    Erel Administrator Staff Member Licensed User

    Why do you want to compile it to a library? It will not work as many modules reference variables from the main module (which will not be compiled into the library).
     
  7. iCAB

    iCAB Well-Known Member Licensed User

    Sorry my mistake ... not familiar with B4J properly ...I just wanted to create the .jar file and I didn't know that I need to compile in release mode.

    1. Can you please let me know what is the name of the process that runs
    2. Can we control the name process name
    3. and what is the proper way to launch a process like this at startup..
    4. also how do we terminate and restart the process

    The reason for my questions above:
    I downloaded "Process Explorer", and I tried to find out the name of the process by locating the process locking the .jar file after I launched from the command line. I terminated the process, but I still get address in use when I try to run the server from the B4J.

    Please clarify



    Thank you
     
    Last edited: Jun 24, 2015
  8. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for these questions.
     
  9. iCAB

    iCAB Well-Known Member Licensed User

    Hi Erel

    After adding WSPushService to my app, I started getting "Unfortunately ProgramName has stopped" after terminating the app.
    The issue is due to some uninitialized variables that are being access by the Service ( please note that there is no issue while the application is running as all these variables are initialized proper during run time )

    I am not sure what I am doing wrong in here, but here is what I have done so far

    Code:
    #Region  Service Attributes
        
    #StartAtBoot: false
        
    #StartCommandReturnValue: android.app.Service.START_STICKY
    #End Region
    Code:
    Sub Activity_Destroy
        
    Try
      
            
    StopService(WSPushService)
           
    Log(  "destroyed" )
          
        
    Catch
      
            
    Log(LastException)
          
        
    End Try
      
    End Sub
    I have also commented out: StartServiceAt in Service_Start

    any advise is greatly appreciated
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question. Also make sure not to limit your question to a single member.
     
  11. salim safran

    salim safran Member Licensed User

    did any try to run such a b4j web application for example on raspberry pi in away configured as captive portal so when access as wifi spot will be directly forwarded to the bj4 web application without needing to worry about the ip address. the procedure is documented on the internet but will appreciate your input on this issue within b4j
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  13. Douglas Farias

    Douglas Farias Expert Licensed User

    @Erel when you have a time add option to login with face google or twitter on the login example pls?
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    You should post it in the wishlist forum.
     
  15. yontala

    yontala Member Licensed User

    I am very confused. I 'm trying to do the example "HelloWorld" application from scratch but, when compiled in release mode I don't see the files "b4j_ws" and "index" . I understand that I have to make an HTML index, but in the example there are two index and "b4j_ws". Can some one help me?

    upload_2015-11-30_12-22-52.png
     
  16. DonManfred

    DonManfred Expert Licensed User

    you started to use the wrong source and posting to the wrong thread?

    If you are talking about the HelloWorld then i guess you should use the source in this thread instead if this here

    With the right source you will see
    E:\B4J\Projekte\WebAppHelloWorld\Objects\www (please note this is my path)


    [​IMG]

    As you can see in my snapshot there are ONE html-file, ONE CSS-file and ONE b4j_ws.js javascript file

    Please note that you should show the file extensions. It would make some things easier like now where you are irritated.
     
    lemonisdead and yontala like this.
  17. yontala

    yontala Member Licensed User

    Wow!
    Thank you!
    I finally understand . The problem is that my PC does not recognize these files.
    I use windows 7.

    I apologize , I saw the link of "HelloWorld" app at the beginning of this post.

    upload_2015-11-30_14-21-55.png
     
    Last edited: Nov 30, 2015
  18. Erel

    Erel Administrator Staff Member Licensed User

    This is not the correct place to post questions.
     
  19. yontala

    yontala Member Licensed User

    Sorry, where is the place to this kind of question?
     
  20. DonManfred

    DonManfred Expert Licensed User

    NOT in the Tutorial-Thread

    Create a Thread in the B4J Question forum.
     
    Erel likes this.
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