Execution for Android Using the Device

Applications generated for Smart Devices can be prototyped directly on the device. In fact, prototyping directly on the device is always more accurate and effective than using the emulator.

The reasons for this are:

  • The emulator lacks resources (calendar, camera, third-party applications for interacting)
  • It is easier to handle (interaction is done with manual gestures instead of using the mouse)
  • What you see is what you get: the emulator continues to be what it is, i.e. an emulator. What is executed on the device is what will be released in the end.
  • Gyroscope, shaker, touch sensitive: better on the device than in the emulator.
  • Faster: the device is quicker (more responsive) than the emulator.

There are different options to prototype the application directly on the device:

Prototyping the application on the device connected to PC

  • Enable USB debugging on the device. This can be done by enabling this option: “Settings -> Applications ->Development -> USB Debugging”.
  • Before executing the application, connect the device to the PC (its driver must be previously installed).
  • If a Startup Object (e.g. dashboard) was set just press F5; otherwise use "right button/run" option. It will recognize the device as an Android device and will run the application in it (the emulator will not be opened in the PC).

Prototyping from QR codes

Download the application to the device (.apk file) and run it

  • Make sure that you have compiled the application before installing it. To compile the application you can make a build/rebuild of the dashboard object or run it (see Build/Rebuild/Run).
  • Copy the .apk file to the SD card of the device. It is located at: <Knowledge base directory>\<Target Environment directory>\mobile\Android\<Main Startup Object>\bin
    For example, if the KB was called ControlCar and the main startup object was called DashCar, the .apk file would be at:
  • These .apk files (which don’t belong to Android's Market) have to be enabled in order to be executed on Android devices. This can be done by enabling this option: “Settings -> Applications -> Unknown sources”.
  • Lastly, copy the .apk file to the SD card of the device, install it with a click and run.

When the application is running, check that the target server of the application is visible from the device for it to work correctly. Typically, it is a public server on the Internet. Its URL is in the Web Root property of the web model. The target server is the server where the database is hosted and the place from which the REST Web Services will be consumed. In general, when we prototype the application the Web Root property has a value similar to http://localhost:10080/MyKBNameRubyEnvironment/, but it can’t be seen from the device.

See Also

Emulation for Android
Prototyping device selection - Android
All about Android prerequisites
Android - FAQ and Common Issues
Knowledge Base Navigator


Start Video Prototyping and Executing
Start Video Deploying