This document is a step by step explanation of how to create a simple Android application with Genexus X Evolution 2 using Ruby and SQLServer. If you are using other generator (.NET Generator or Java Generator) or DBMS the steps are the same but prerequisites change.
Before starting with the following steps please check that the prerequisites are correctly installed. See this for more information.
Step 1
Create a New Knowledge Base with GeneXus X Evolution 2 and select Ruby as a Prototyping Language (if you want you can use .NET Generator or Java Generator).

Step 2
Create a Customer and Company transaction with the following structure.


Note the predefined domains in the attributes.
In both cases use autonumber in the identifier attribute.
Step 3
Apply the Work With Smart Devices pattern to the transactions.

On the Toolbox drag & drop the attributes you want to see on the Selection list screen.

Step 4
Create a Dashboard Object called Menu. This object is like a menu, you can use it to call the Work With object created in the Step 3

Right click in the Items option to add actions to the dashboard. You must select the WWforSD object in the displayed dialog:

When you select a WWforSD 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
Edit the SmartDevices Generator Preferences. Set the following properties:
-
Generate Android: True (by default)
-
Generate BlackBerry: False
-
Generate iOS: False
-
Main Platform: Android
-
Android SDK directory: Select the Android SDK directory (e.g. G:\android-sdk-windows)
-
JDK Directory: Select the JDK directory (e. g. C:\Program Files\Java\jdk1.6.0_11)

Step 6
Press F5 to build the application. At the first time you do this GeneXus needs to know the data base connection information. This may help too: First Ruby Model

This output is shown, and then GeneXus automatically runs your default browser and the Android Emulator:

Step 7
In this step it is recommended that you create some Companies and add some Customers in the WEB application.
Now GeneXus opens the Android emulator and execute the application.
The first time may take longer because the emulator Starts the android OS

After that the application starts

Step 8
Execute your application in your Android device:

See this for more information.
Enjoy it!
Some Pics

Tips
- To simplify the prototyping process, is recomended not to close the emulator between runs.
- This link is another tutorial with some aditional help for troubleshooting (spanish only).
Download the XPZ
My First Android Model
For more information check Android - FAQ and Common Issues
See Also
My First Apple Application
My First BlackBerry Application
|