User:anonymousLog inRegister
Recents:
My first Android Application

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).

Image:SD Creating KB

Step 2

Create a Customer and Company transaction with the following structure.

Image:Android GX Step 2

Image:Android GX Step 3

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.

Image:SD Applying WW to Customer

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

Image:SD draging attributes to layout

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

Image:Android GX Step 5

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

Image:SD Getting Started Dashboard

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)

Image:SD Android generator properties

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

Image:SD GettingStarted Set Build Proccess

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

Image:SD GettingStarted Ouput

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

Image:SD Android Emulator Launched

After that the application starts

Image:SD GettingStarted URL

Step 8

Execute your application in your Android device:

Image:DeveloperMenuWithQR_3

See this for more information.

Enjoy it!

Some Pics

Image:SD GettingStarted Some Pictures

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

 

Created: 10/29/10 03:32 PM by roal Last update: 03/22/12 11:51 AM by fedes_1987
 
Page
Share
Categories
Group
Powered by GXwiki 4.0 Beta1 (generated with GeneXus X Evolution 2)