Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Android Google Maps

You're reading from   Learning Android Google Maps Integrate Google Maps with your Android application to offer feature-rich and interactive maps

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher Packt
ISBN-13 9781849698863
Length 356 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. Setting Up the Development Environment 2. Configuring an API Key and Creating Our First Map Application FREE CHAPTER 3. Working with Different Map Types 4. Adding Information to Maps 5. Interacting with a Map 6. Working with Custom Views 7. Working with Location Data 8. Know about the Street View 9. Google Maps Intents 10. Creating a Custom Map Application A. Answers to Self-test Questions Index

Setting up AVD for testing

AVDs are used to virtually test the app on your PC. You may not have different versions of Android with different screen resolutions. To overcome this issue, AVDs are used to virtually create a number of devices and test whether the app runs perfectly on a particular version of Android. One thing to note is that AVDs are much slower compared to physical devices. Now, let's create an AVD to test our Google Maps Android application. The AVD Manager looks a bit different in Android Studio than in the traditional one. There are two different targets of an AVD, they are:

  • Pure AOSP target, which does not contain any additional apps
  • Google API target, which has Google Play services preinstalled

The different architectures available are x86 and ARM.

Setting up AVD from Android Studio

In this section, we will set up AVD from the Android Studio IDE by performing these steps:

  1. Open AVD Manager in Android Studio by navigating to Tools | Android | AVD Manager. The following window will appear:
    Setting up AVD from Android Studio

    AVD Manager

  2. The following screenshot shows how to select the virtual device:
    Setting up AVD from Android Studio

    Selecting the virtual device

  3. The next step is to select a system image. The following window will appear. Select a system image with the Google APIs target. The x86 system images have better emulation speed than an ARM system image. Then, select Next.
    Setting up AVD from Android Studio

    Selecting the API target

  4. In the next screen, you can change some advanced settings. They are:
    • You can change the amount of RAM of your virtual device
    • You can change the internal and SD storage size
    • You can use your PC's webcam to support the Android camera
    • Enabling host GPU helps for better emulation speed as it uses your PC's graphics processor to render

    The following screenshot shows these additional options:

    Setting up AVD from Android Studio

    Additional options

  5. After changing the settings, finally select Finish. You will see a screen with a list of virtual devices created. To start a virtual device, press the green button under the Actions section.
    Setting up AVD from Android Studio

    Created AVD

It may take some time for the emulator to start according to the speed of your PC.

Setting up AVD from Android Studio

The preceding screenshot shows an emulator running Android Lollipop 5.0 with the Google API.

Setting up AVD from Eclipse

In this section, we will set up AVD from the Eclipse IDE by performing these steps:

  1. Let's see how to create an AVD from the Eclipse IDE. Open the AVD manager in Eclipse by navigating to Window | Android Virtual Device Manager.
  2. In the Android Virtual Device (AVD) Manager window, you will see the list of virtual devices created with the predefined device definitions.
    Setting up AVD from Eclipse

    AVD Manager

    The following screenshot shows the AVD Manager with the device definitions:

    Setting up AVD from Eclipse

    AVD Manager with device definitions

  3. To create a new virtual device, select a device configuration and click on the Create AVD button. The following window will appear. You can change the advanced configurations, amount of RAM, and so on.
    Setting up AVD from Eclipse

    Creating a new virtual device

  4. Then, press OK. Your virtual device will be created. The following window will appear with the list of virtual devices created:
    Setting up AVD from Eclipse

    Created virtual devices that are listed

  5. To start the virtual device, select a virtual device from the list and press the Start... button. The emulator will be running.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image