Tutorial: database

The scope of this tutorial is to learn, how to add new tables, prepared statements etc. into your App.
The tutorial is based on a newly created innovaphone App with the Visual Studio plugin.

We will also make use of the javascript innovaphone.ui1.Scrolling object and the UTaskTemplate of the task classes.

Task

Step by step

The used file and class names in this example are based on a newly created App with the name NewApp1 and the company name innovaphone.
Your filenames might be different according to your settings.

Creation of a new table

Header file NewApp1_tasks.h, cpp file NewApp1_tasks.cpp inside the NewApp1 folder.

Creation of prepared statements

Header file NewApp1.h, cpp file NewApp1.cpp inside the NewApp1 folder.

Use of the prepared statements inside the already existing class TaskReadWriteCount

Header file NewApp1_tasks.h, cpp file NewApp1_tasks.cpp inside the NewApp1 folder.

Create a new class TaskGetHistory to retrieve the history rows

Header file NewApp1_tasks.h, cpp file NewApp1_tasks.cpp inside the NewApp1 folder.

Implement the message type GetHistory in the NewApp1Session class

Header file NewApp1.h, cpp file NewApp1.cpp inside the NewApp1 folder.

Add the innovaphone.ui1.Scrolling class to our project

NewApp1.mak in the root folder, innovaphone-newapp1.htm in NewApp1/apps

Retrieve the history with GetHistory in javascript and add it to the ui1.Scrolling class

innovaphone-newapp1.js inside NewApp1/apps

Try it out

If you know compile and run your NewApp1 App, you can open it from myApps.
You can play around with the counter, close the App and open it again.
Then you should see the last history entries (the history entries are not live updated, just received once on start of the App).

Usefull documentation for this task

Database

Tasks

innovaphone.ui1.Scrolling