B4J Tutorial [Pen&Paper] Create & Run a simple 'Hello ABMaterial' WebApp

Discussion in 'B4J Tutorials' started by Mashiane, Sep 10, 2017.

  1. Mashiane

    Mashiane Expert Licensed User

    Hi there

    I have been requested to do a simple something on how one can create a simple ABMaterial WebApp using the Pen&Paper code generator. The attached video seeks to demonstrate with a simple 'Hello ABMaterial' ABMLabel, just how one can just do that.

    The expectations for anyone to use Pen&Paper is that they know ABMaterial. One needs ABMaterial 3.5 do compile the generated source code.

    1. Download Pen&Paper from here.
    2. Follow the attached video (switch to HD view)

    This covers...

    1. Creating a new project
    2. Create a new page
    3. Adding a ABMLabel on the page RC location and specifiying its text
    4. Compiling the generated B4J ABMaterial source code
    5. Running the generated ABMaterial WebApp on your browser.

    Everything else Pen&Paper is here.

  2. Mashiane

    Mashiane Expert Licensed User

    Source Code Files for this example

    Attached are two sqlite files. hello.zip is the application database (i.e. the one to be distributed with the app) and projects_hello.zip contains the pen&pen source code project.

    1. Create a folder and save the pen n paper.jar inside it. As soon as you start the jar file, some folders will be created. The projects folder will store all the projects you create.
    2. Create a project called hello inside pen & paper. This will create a hello folder and a hello.db file in the projects folder. Close the pen & paper application.
    3. Unzip hello.db in the root folder where the pen & paper jar is residing
    4. Unzip the projects_hello.zip in the projects folder, this should replace the existing hello.db that exists.
    5. You now should have two hello.db files, one in the root of where you have the jar file is stored and the other inside the projects folder.
    6. Open pen & paper.jar again. Open the hello project, this will now open the newly updated project.
    7. On the project screen, browse to the hello.db file in the root folder for the database file, click Apply.
    8. Compile the project, the source code will be generated...

    Attached Files:

  3. MbedAndroid

    MbedAndroid Active Member Licensed User

    i downloaded your project from dropbox. Start Pens&Papers.jar.
    It opens. When i click new, it asked for a projectname. Insert a new project name, after that the program quits...?
    It saves the new database. When i retry to open this database, same issue...program quits..
    Same to your hello.db

    Whats wrong?
    Last edited: Sep 12, 2017
  4. Mashiane

    Mashiane Expert Licensed User

    I have recompiled Pen&Paper and fixed the bugs, please download a new version from this post here...
  5. MbedAndroid

    MbedAndroid Active Member Licensed User

    i downloaded already the new version and the problem is gone.
    New problem is that after compiling a page i got the message: no connection to the database... Might be a setting?
  6. Mashiane

    Mashiane Expert Licensed User

    Yes, see #7 in post 2. Do a Test Connection first to see if the connection to the db has been established. Yes the database is not needed for this particular example but by default with the templates, the assumption is that there is a database. I will add an option to disable a database in an upcoming version.

  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