My First Windows Phone application

Official Content

This document is a step-by-step explanation of how to create a simple Windows Phone application 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 Phone 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.

Step 1 Create KB

New KB WinPhone

Note: It is not necessary to use CSharp as web generator, Java and Ruby are also available.

Step 2 Create objects

Create a Customer and Company Transactions with the following structure:

Customer TRN WinPhone

Company TRN WinPhone

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.

Apply Pattern WinPhone

Step 4 Create Dashboard

Create a Menu for Smart Devices object called Menu.

Create Dashboard WinPhone

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 on the Items option to add actions to the Dashboard. You must select the WorkWithDevices<TransactionName> objects in the Select Object dialog:

Add Actions WinPhone

Actions WinPhone

When you select a WorkWithDevices<TransactionName> object, the Event associated with 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:

Environment Settings WinPhone

By default Android and iOS are generated, so to generate Windows Phone you must select “Smart Devices” node, set “Generate Android” and "Generate iOS" to “false” and “Generate Windows Phone” to “true”.

SD Settings WinPhone

After that, set the startup object:

Start up object WinPhone

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:

ImpactAnalysis WinPhone

and the application is generated.

Run Output WinPhone

See also

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