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 Online Native Mobile 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.
Create a Customer and Company Transactions with the following structure:
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).
Apply the Work With object pattern on both Transactions.
Create a Menu for Smart Devices object called Menu.
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:
When you select a WorkWithDevices<TransactionName> object, the Event associated to this action will be generated automatically:
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:
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”.
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.
By pressing “Create”, the tables are created:
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.
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:
Take a look at Windows 8 Application Running quick overview to know how the application looks like or check out this video