Table of contents



Official Content

This document is a step-by-step explanation of how to create a simple Android application with GeneXus using .NET and SQLServer. If you are using another generator (Java) or DBMS, the steps are the same even though the prerequisites change.

Before starting the following steps, please check that the Android Requirements are correctly installed. See Android platform for more information.


Step 1

Create a New Knowledge Base and select .NET as Prototyping Environment (you can also select Java).

CreateKnowledgeBase-GX18

 

Step 2

Create the Customer and Company Transaction objects with the following structures:

Create transaction

Note the Domains with Special Semantics in Phone, Email, Address attributes.

Next, auto-number the identifier attributes. While positioned in the CustomerId field, go to the Properties window and change the Autonumber property to True. Do the same for the CompanyId attribute.

Step 3

Apply the Work With pattern to both Transactions. To do so, open each Transaction, click on the Patterns selector, choose the Work With tab, and select the "Apply this pattern on save" checkbox as shown below. Next, click on Save:

My first Android application - ApplyingWWPatternToCustomerTrn - GX18

From the Toolbox, drag the control Attribute/variable to insert the attributes you want to see on the Customer list screen (i.e., CustomerEmail):

My first Android application - WorkWith - List - AddingAttributeInLayoutGrid

To remove the attribute label, change the Label position property value to "None":

My first Android application - WorkWith-LabelPositionNone-01

My first Android application - WorkWith-LabelPositionNone-02

Step 4

Create a Menu object called, for example, Menu. 

Creating a Dashboard from New Object Window

This object is like a menu that you can use to add items/actions in order to call the Work With objects created in the previous step. To do so, right-click on the Items option and add two consecutive actions to the Menu. Each action must be associated with each Work With. You will be able to select the WorkWithCustomer in the Select Objects dialog for the first action and the WorkWithCompany for the second action:

My first Android application - Menu-Add-Action - GX18

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

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

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

Step 5

Edit the Native Mobile Generator Preferences. Make sure you have set the following properties:

My first Android application - Prefrences - GX18

With these settings, the Android and iOS code will be generated. In addition, the Android platform application will be executed at runtime.

Step 6

Before pressing F5 to build and run the application, you have to set a Main object as Startup Object. Menus by default are Main (their Main Object property is set to True by default), so set the Menu as Startup Object:

My first Android application - Set as Startup Object

Next, press F5. The first time you do it, GeneXus needs to know the database connection information. 

My first Android application - Set up build process

The other option is to deploy to cloud.

The following output is shown, as well as the Impact Analysis report, indicating the tables that must be created in the database. Click on the Create button to create them. 

My first Android application - Impact analysis report

Then, GeneXus automatically runs the Android Emulator:

SD GettingStarted Ouput - GeneXus 17

You are now ready to test it!

To do so, tap on the Work With Customer option. The following screen will be displayed:

WorkWithCustomerAndroidEmulator

Continue testing the application by inserting data and updating, deleting, searching, filtering, adding companies, etc.

Some Pics

SD GettingStarted Some Pictures

Enjoy it!

Note 

To display the desired image for each menu action, go to the Menu object created in step 4. Then, while positioned on each action, associate the image (inserting it simultaneously in the KB) through the properties dialog:

Image Dashboard Action Property

Tips

  • To simplify the prototyping process, we recommend not closing the emulator between runs.

Download the XPZ

To import GeneXus objects used in this demo, right on your KB, download this file.

Videos

First steps with a native mobile app

See also

For more information, check Apple - FAQ and Common Issues

 

Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant