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 is 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 Phone Requirements are correctly installed.

In the following example, you will write a simple application that lets you register companies and their customers. By the end of the sample, you will have an application that allows you 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 a 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 the Autonumber property to True 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 pattern and Work With object pattern on both Transactions.

Apply Pattern WinPhone

Step 4 Create Dashboard

Create a Menu 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 Objects 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 example, you will 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.

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

 

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant