getting-started

How it works

Development involves writing the client side application over the client SDK and the server side application using the server side SDK.

The best to get started is to get the sample server and client application running. We will explain the process through the chat server application. Other samples provided (SpaceWarFare, Rummy cards etc.) can also be run in a similar way.

You can follow the steps below – there is also a video which illustrates running of the sample from scratch.

Watch Video

Note AppWarp S2 requires the following to be installed on the server machine.

  • JAVA: JDK 1.7 or above
  • ANT: apache-ant-1.8.3 or above

  1. Create a ShepHertz account on our dashboard.
  2. Navigate to the AppWarp OnPremise tab on the left and download the zip file.
  3. Unzip and navigate to Chat Server folder.
  4. You can either run the server using the provided script files (OS dependent) or open it as a project in your favorite Java IDE such as Eclipse or Netbeans.
  5. To run using script, ensure the script files from SDK/server/script are there in the ChatServer folder. You can now run the scripts from the command line or simply double click on them.

Starting the server application

windows

This will launch the server in a new command prompt.

windows_start.bat

linux

linux_start.sh

MacOS (run directly using ANT)

ant -f warp.xml

Launched client

To run using Eclipse IDE, do the following steps

  1. File->New->Java Project
  2. Enter project name for example ‘ChatServer’
  3. Finish
  4. Right click the project and import->File System
  5. Import the downloaded ChatServer folder and click OK
  6. Verify that the project is setup correctly and looks something like below
  7. Now add the JAR files in the lib folder to your “build path”
  8. Run the project (select the Main class in the ChatApp when prompted)

Similarly, you can do it for NetBeans.

Now you need to create a zone using the dashboard (required only first time)

  1. Navigate to the downloaded AdminDashboard folder.
  2. Run the mongoose.exe application or you can use another web server of your choice.
  3. Navigate to http://localhost:8080/#/ (if running through mongoose)
  4. Note that the server from the previous step must be running before you open the dashboard.

  1. Now enter the username and password as in your AppConfig.json file (default values are matching so just click sign in)

  1. Now click on the zones tab on the left
  2. Now enter a zone name and click on “Create Zone”

  1. Note down the AppKey
  2. Now navigate to the Rooms tab and create a new room by entering the same AppKey as in the last step.

  1. Note down the room id generated.

Now we are ready to edit and run the client HTML5 application

  1. Open the index.html file in the HTML5ChatClient folder in a text editor
  2. Replace the apiKey var value with the AppKey of the zone you created earlier.
  3. Replace the AppWarpS2Host var value with the address of the server.
  4. Save the file and open it in a HTML5 supported browser like Chrome.
  5. Enter your name and connect.
  6. Now join any of the rooms created earlier (should be visible on the left).
  7. Enter messages and notice how the messages with “profane” text are dropped.

  8. For the Corona client, you need to edit the main.lua file in the Corona client folder as indicated below and replace the values

Now run the sample Corona client.

Congratulations! you just ran your first AppWarp S2 application :)

To understand how the server side logic of this app works read the following document

Samples walkthroughs