My First Windows 8 Application

Official Content

This document is a step-by-step explanation about how to create a simple Windows 8 application (Windows Store Applications) using GeneXus. For demonstration purposes, the CSharp Generator and Cloud prototyping were used. Check Smart Devices online applications architecture for more information about SD application architecture.

Before starting with the following steps please check that the Windows 8 Requirements are correctly installed.

In the following example we will write a simple application which lets you register companies and its customers. At the end of the sample you will have an application to navigate, list, insert, update or delete companies and customers. Take a look at Windows 8 Application Running quick overview or check this video to know how the generated application looks like.

Step 1 Create KB

W8 Step 1 - Create KB

Step 2 Create objects

Create a Customer and Company Transactions with the following structure:

W8 Step 2 - Create Company

W8 Step 2 - Create Customer

Please note that predefined domains were used for certain attributes and, in both cases, be sure to set as True the Autonumber property of each identifier attribute (i.e.: positioned on the CustomerId field, press F4 to see its properties, and change the Autonumber property. Do the same for the CountryId attribute).

Step 3 Apply pattern

Apply the Work With for Smart Devices object pattern on both Transactions.

W8 Step 3 - Apply Pattern

Step 4 Create Dashboard

Create a Menu for Smart Devices object called Menu.

Creating a Dashboard from New Object Window

This object is like a menu; you can use it to call the Work With objects created in the previous Steps. To do it: right click in the Items option to add actions to the Dashboard. You must select the WorkWithDevices<TransactionName> objects in the Select Object dialog:

SD Getting Started Dashboard

When you select a WorkWithDevices<TransactionName> object, the Event associated to this action will be generated automatically:

Event 'WorkWithDevicesCustomer'
     WorkWithDevicesCustomer.Customer.List()
EndEvent

Event 'WorkWithDevicesCompany'
     WorkWithDevicesCompany.Company.List()
EndEvent

Step 5 Environment settings

For this sample we are going to use Cloud prototyping. By just setting the “Deploy to cloud” property to “yes”, all the necessary preferences are set:

W8 Step 6 - Environment

By default Android is generated, so to generate Windows 8 you must select “Smart Devices” node, set “Generate Android” to “false” and “Generate Windows 8” to “true”.

W8 Step 6 - Environment - W8 Generator

Step 6 Run

After configuring the environment, press F5 to create the DB and generate the application.

Since the cloud is being used, a Gxtechnical user is needed. If you don’t have a user account, create one here.

W8 Step 7 - Run Gxtechnical user

By pressing “Create”, the tables are created:

W8 Step 7 - Run table creation

and the application is generated.

The first time a GeneXus-generated application is run on the PC, a certificate is needed to sign it and to register as a Windows 8 Developer. Follow the next steps or check this video to do so.

Certificate Installation

The first time a GeneXus-generated application is run on the PC, the following message is displayed: “The certificate used to sign the appx is not trusted by this computer. Please import it and try again.”

Explanation: To run an application, it must be signed. GeneXus generates a “certificate file” (i.e. gxwin8dev.cer) to sign the generated applications; however, this “certificate” must be manually installed by the developer. To do so, please follow Windows 8 - Application certificate installation in order to install it.

Windows 8 Developer Registration

Once the certificate is installed, run (F5) the application again and the following message is displayed:

“You do not have a registered Windows Developer License.
Calling Windows Developer License registration...”

Explanation: you must be registered as a Windows 8 application developer in order to compile W8 apps. A Windows 8 Application Developer License Registration Wizard is automatically started and it must be completed in order to compile.

Finally, your application is compiled, signed and started with a message similar to the following:

W8 Step 7 - Run output

Bonus track: How does the application look like?

Take a look at Windows 8 Application Running quick overview to know how the application looks like or check out this video

See also

 



Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.