Android Device Monitor

The Android SDK ships with the Android Device Monitor (ADM) app, which is packed with features that help you develop and debug your app either while it is running in an emulator or on a device. The Android Device Monitor supersedes the Dalvik Debug Monitor Service (DDMS) app, which provides similar capabilities. In this section, we will look at how we can use ADM to manage files.

First, let's add a menu item under the Tools menu in Xamarin Studio for easy access by performing the following steps:

  1. Select Tools | Options.
  2. Under the Environment section, click on External Tools and then click on Add.
  3. Enter Android Device Monitor for the title.
  4. Click on the Browse action for the command, navigate to Tools under the SDK location, select Android Device monitor.bat and click on Open. The SDK location can be determined by clicking on SDK Locations | Android in the Options dialog box.

To copy files to an emulator or device, perform the following steps:

  1. Start ADM by selecting the newly created Tools menu item. When ADM starts, you will see currently running emulators and connect devices listed on the left-hand side of the window.
  2. Select the emulator instance or connected device you would like to work with.
  3. Select the File Explorer tab on the right-hand side of the window. If the File Explorer tab is not visible, select Window | Show View from the main menu and click on File Explorer.
  4. Navigate to /storage/sdcard/POIApp. There should be no files listed under the folder. While working with actual devices rather than emulators, the physical folder to navigate to may not be obvious due to various mounts that may be in place. For example, the actual location on my HTC One, /mnt/shell/emulated/0. ADM will display mounts to the right-hand side of each folder listed as follows:
    Android Device Monitor
  5. Click on the Push file onto the Device button in the upper-right corner of the tab. Navigate to the data folder in the assets location, select poi1.json, and click on Open.
  6. Repeat step 5 for each *.json file in the data folder.
  7. Switch back to the Android emulator and click on the Refresh action in POIApp. You should now see the POIs listed.

The files that we uploaded from the assets folder are simple text files encoded using JSON. The JSON specifications can be viewed at www.json.org. We will not cover the JSON specifications in this book, but you can create additional JSON files using any text editor and using the existing files as templates.

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

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