Time for action – starting an Android Virtual Device

You will have to dig a little deep in the Android SDK folders to find the Android Virtual Device setup program. You might as well provide a shortcut or an alias to it for quicker access. The following steps will help you setup and start an Android virtual device:

  1. Navigate to the Android SDK tools folder located at C:Program Files (x86)Androidandroid-sdk on Windows and navigate to your Documents/android-sdk-macosx/tools folder on Mac.
  2. Open AVD Manager on Windows or android on Mac (these look like a Unix executable file; just double-click on it and the application will open via a command-line window).
  3. If you're on Mac, select Manage AVDs… from the Tools menu.
  4. Select Tablet from the list of devices if there is one. If not, you can add your own custom devices as described in the following section.
  5. Click on the Start button.
  6. Sit patiently while the virtual device starts up!
  7. Open LiveCode, create a new Mainstack, and click on Save to save the stack to your hard drive.
  8. Navigate to File | Standalone Application Settings….
  9. Click on the Android icon and click on the Build for Android checkbox to select it.
  10. Close the settings dialog box and take a look at the Development menu.
  11. If the virtual machine is up and running, you should see it listed in the Test Target submenu.

Creating an Android Virtual Device

If there are no devices listed when you open the Android Virtual Device (AVD) Manager, you may If you wish to create a device, so click on the Create button. The following screenshot will appear when you do so. Further explanation of the various fields can be found at https://developer.android.com/tools/devices/index.html.

Creating an Android Virtual Device

After you have created a device, you can click on Start to start the virtual device and change some of the Launch Options. You should typically select Scale display to real size unless it is too big for your development screen. Then, click on Launch to fire up the emulator. Further information on how to run the emulator can be found at http://developer.android.com/tools/help/emulator.html.

Creating an Android Virtual Device

What just happened?

Now that you've opened an Android virtual device, LiveCode will be able to test stacks using this device. Once it has finished loading, that is!

Connecting a physical Android device

Connecting a physical Android device can be extremely straightforward:

  1. Connect your device to the system by USB.
  2. Select your device from the Development | Test Target submenu.
  3. Select Test from the Development menu or click on the Test button in the Tool Bar.

There can be problem cases though, and Google Search will become your best friend before you are done solving these problems! We should look at an example problem case, so that you get an idea of how to solve similar situations that you may encounter.

Using Kindle Fire

When it comes to finding Android devices, the Android SDK recognizes a lot of them automatically. Some devices are not recognized and you have to do something to help Android Debug Bridge (ADB) find these devices.

Android Debug Bridge (ADB) is part of the Android SDK that acts as an intermediary between your device and any software that needs to access the device. In some cases, you will need to go to the Android system on the device to tell it to allow access for development purposes. For example, on an Android 3 (Honeycomb) device, you need to go to the Settings | Applications | Development menu and you need to activate the USB debugging mode. Before ADB connects to a Kindle Fire device, that device must first be configured, so that it allows connection. This is enabled by default on the first generation Kindle Fire device. On all other Kindle Fire models, go to the device settings screen, select Security, and set Enable ADB to On.

The original Kindle Fire model comes with USB debugging already enabled, but the ADB system doesn't know about the device at all. You can fix this!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset