Skip to content

mqprichard/PlacesDemo-Maven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Android demo using the Google Geocoding, Elevation and Civic Information APIs: the project builds a simple Android application that gives geocoding and elevation data, plus a complete list of elected officials (in the US at least), for a given address string. The application will run fine on a connected device or AVD emulator (use an Android-21 system image). The same source code project can be used to build Maven and ant (Eclipse ADT) builds.

Using Google APIs

You will need a Google API key to access the Geocoding API, Elevation API and Google Civic Information API: these services have courtesy limits, which allow limited use free of charge. Use the Google API Console to create a Google API project, add the required services (APIs & Auth -> API) and then create an API Key (APIs & Auth -> Credentials). Create a Browser key and leaved the Allowed Referers field blank.

Create the following class file (GooglePlacesKey.java) in src/com/example/appdynamics/placesdemo and paste in your API key:

package com.example.appdynamics.placesdemo;

public class GooglePlacesKey {
    public static final String API_KEY = "<your API key>";
}

Eclipse ADT Builds

  1. Import -> Existing Android code into workspace
  2. Properties -> Android -> Android 5.0 (API Level 21)
  3. Build Path -> Configure Build Path -> Libraries -> Add External JARs
  4. Clean and rebuild the project

The following JAR files need to be added to the project:

Maven Builds

  1. To build: mvn clean install
  2. To deploy to a connected device or emulator: mvn android:deploy
  3. To run: mvn android:run

To build with different Android platform versions, download the maven-android-sdk-deployer tool and follow the instructions in the README file. For example, to install Maven libraries for Android-21, run mvn install -P 5.0 and use the following dependency:

<dependency>
  <groupId>android</groupId>
  <artifactId>android</artifactId>
  <version>5.0_r1</version>
  <scope>provided</scope>
</dependency>

About

Android demo with Google Geocoding, Elevation and Civic Information API (Maven)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages