Native Mobile Applications 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 listed below.
- Enable USB debugging on the device. Android - Enable developer options and 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).
- 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 you prototype the application the Web Root property has a value similar to http://localhost/MyKBNameNetEnvironment/, but it can’t be seen from the device. So you must change the Services URL property to use the IP value, for example to the value http://192.168.86.43/MyKBNameNetEnvironment/ where 192.168.86.43 is the IPv4 Address of localhost (you can get it with the command ipconfig /all). Also, make sure the PC is using the same wifi as the device.
Set the Android Execution Type property to Genexus Project Navigator, download the GeneXus Project Navigator from here and use it in your device.