Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算 https://developers.google.com/maps/documentation/android/

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Location-Based Services: Part 2 (Google Maps)
16.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft® Windows® Server 2003 Active Directory Infrastructure.
Get android development environment running. Install – Get and install JDK 5 or 6 (see link in the.
1 Mobile Computing Mobile First (formerly Worklight) Copyright 2015 by Janson Industries.
Coursework 2: getting started (4) – using PhoneGap to build mobile applications (optional) Chris Greenhalgh G54UBI /
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Views Dwight Deugo Nesa Matic
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Setting up the Development Environment Copyright © SUPINFO. All rights reserved Preparation.
How to make it work? Doncho Minkov Telerik Academy academy.telerik.com Technical Trainer
Virtual Reality Course Slide  NTU Mobile HCI Lab, Mike Chen   Android Developers 
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
Android Tutorial Larry Walters OOSE Fall References This tutorial is a brief overview of some major concepts…Android is much richer and more complex.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Application Development 2013 PClassic Chris Murphy 1.
Programming with Android: The Google Maps Library Slides taken from Luca Bedogni Marco Di Felice.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
1 Guide to Novell NetWare 6.0 Network Administration Chapter 11.
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
PARSING FACEBOOK DATA FOR ANDROID 1. Step by Step  Import Android SDK  Get the hash key  Create a new app  Create a new project in Eclipse 
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
26/05/2016 E.R.Edwards 26/05/2016 Staffordshire University School of Computing Introduction to Android Practical 1 Changing the Eclipse Workspace Importing.
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
How to publish your app 1 CS440. Step 1: Remove any debug logging  Good practice: comment out any debug logging  Why? CS440 2.
Overview of Android Application Development
Android architecture & setting up. Android operating system comprises of different software components arranges in stack. Different components of android.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
GumTree Development Environment Setup Windows Only Compatible with Eclipse 3.2 M3 (Last update: 16/11/05)
Liferay Installation Prepared by: Do Xuan Hai 8 August 2011.
Installing Repast in the Eclipse IDE Charlie Gieseler 6/28/04.
Android Studio IDE Tools Operation Summary. icle.html icle.html.
First Venture into the Android World Chapter 1 Part 2.
Location-Aware 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
WELCOME. YOU GUYS USE TO PLAY GAMES RIGHT ? FIFA12, PES12, and much more… I know you love that ! And it all comes from the other side ! So why can’t you.
Appium with Android Configuration.  Download Appium server:  Choose the latest version of appium.
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
DEVOLOPING ANDROID APP ON LOCATION BASED REMINDER ON ANDROID MOBILE SYSTEMS.
Installation of Visual Studio Android emulator and Android Studio
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
Time to apply stuff… Faculty of Mathematics and Physics Charles University in Prague 5 th October 2015 Workshop 1 – Java Wrestling.
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
GOOGLE PLAY By William Cook April 14, GOOGLE PLAY Marketplace for apps for android Androids “app store” You must make an account on the developer.
Master Software Solutions Pvt.Ltd.. These days the demand of smart phone is being increased and we have different types of client e.g. Touch Phone, tables,
Chapter 6 Google Play Services GOALS & OBJECTIVES Google Play Services give you features to attract users using Google features such as Google Maps, Google+,
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
IBM Worklight environment setup 1. Eclipse IDE Multi-purpose integrated development environment (IDE) Open source Supported for Windows, Mac OS X, Linux.
Day 1 Session 2. Setup & Installation
Location-Based Services: Part 2 (Google Maps)
Obtaining the Required Tools
Android Studio, Android System Basics and Git
Sensors, maps and fragments:
Install Ruby If you are running on Mac OS X, Ruby is preinstalled.
The Most Popular Android UI Automation Testing Tool Andrii Voitenko
Korea Software HRD Center
Working with Libraries
Presentation transcript:

Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算

Introduction to the Google Maps Android API v2 The API automatically handles –access to Google Maps servers –data downloading –map display, and –response to map gestures Also use API calls –To add markers, polygons, and overlays to a basic map, and –To change the user's view of a particular map area 2

3 Distributed as part of the Google Play services SDK Encapsulated in the MapFragment class, an extension of Android's Fragment class, rather in the Activity class –Able to add a map as a piece of a larger Activity –Able to implement them by extending the Android standard Activity class, rather than extending the MapActivity used in version 1 Using vector tiles: data representation is smaller, with less bandwidth Caching is improved, so users will typically see a map without empty areas. Supporting 3D maps Google Maps Android API v2 Improvements

Overall Process of Adding a Map to an App Step 1. Download and configure the Google Play services SDK –The Google Maps Android API is distributed as part of this SDK Step 2. Obtain an API key –To do this, you will need to register a project in the Google APIs Console, and get a signing certificate for your app Step 3. Specify settings in the Application Manifest Step 4. Add a map to a new or existing Android project Run the Sample Code - com.example.mapdemo 4

Run the Sample Code - com.example.mapdemo Make sure Google Play services added as an Android library project 1.Select File > Import > Android > Existing Android Code Into Workspace and click Next 2.Select Browse..., enter /google-play-services_lib, and click Finish View the sample code, or run the sample app locally –Sample code is bundled with the Google Play services SDK 1.Select File > Import > Android > Existing Android Code Into Workspace and click Next. 2.Select Browse..., enter /extras/google/google_play_services/samples/maps, and click Finish 3.Select Project > Properties, select Java Build Path, and navigate to Libraries. 4.Select Add External Jars, include the following jar files, and click OK: + /extras/android/support/v4/android-support-v4.jar 5.Add your own Google Maps Android API key 6.Select Run > Run to test the sample app 5

Step 1. Setup Google Play Services SDK To develop an app using the Google Play services APIs, download the Google Play services SDK from the SDK Manager –The download includes the client library and code samples To test your app when using the Google Play services SDK, you must use either: –A compatible Android device that runs Android 2.2 or higher and includes Google Play Store –The Android emulator with an AVD that runs the Google APIs platform based on Android or higher Three steps: –S1-1. Install the Google Play Services SDK –S1-2. Set Up a Project with the Library –S1-3. Ensure Devices Have the Google Play services APK 6

S1-1. Install the Google Play Services SDK 1.Launch the SDK Manager –From Eclipse (with ADT), select Window > Android SDK Manager 2.Install the Google Play services SDK –Saved in /extras/google/google_play_services/ 3.Install a compatible version of the Google APIs platform –To test app on the emulator, expand the directory for Android (API 17) or a higher version, select Google APIs, and install it 4.Make a copy of the Google Play services library project –Copy the library project at /extras/google/google_play_services/libproject/google-play- services_lib/ to the location where you maintain your Android app projects (i.e. adt-bundle/share) – import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it 7

S1-2. Set Up a Project to Use Google Play Services SDK Reference the library project in your Android project 1.Make sure that both the project library and the application project that depends on it are in your workspace. If one of the projects is missing, import it into your workspace 2.In the Package Explorer, right-click the dependent project and select Properties 3.In the Properties window, select the "Android" properties group at left and locate the Library properties at right 4.Click Add to open the Project Selection dialog 5.From the list of available library projects, select a project and click OK 6.When the dialog closes, click Apply in the Properties window 7.Click OK to close the Properties window 8

Step 2. Obtain an API Key The Google Maps Android API v2 uses a new system of managing keys –Existing keys from a Google Maps Android v1 application, commonly known as MapView, will not work with the v2 API –Obtain a Maps API key from the Google APIs Console by providing the application's signing certificate and its package name –Once having the key, add it to the application by adding an element to the application's manifest file AndroidManifest.xml Maps API keys are linked to specific certificate/package pairs –Sign each of your applications with a different certificate and get a different key for each one Four steps: –S2-1: Retrieve information about your application's certificate –S2-2: Register a project in the Google APIs Console and add the Maps API as a service for the project –S2-3: Once you have a project set up, you can request one or more keys Add your key to your application and begin development 9

S2-1. Displaying Certificate Information An app has two certificates –Debug certificate: only for use with an application for testing –Release certificate SHA-1 fingerprint: a short form of application's digital certificate –Eclipse goes to Windows > Preferences > Android > Build 10

S2-2. Obtaining an API Key Go to 1.API Project > Services: Enable Google Maps Android API v2 2.API Project > API Access > Create New Android Key Enter the SHA-1 fingerprint, then a semicolon, then your application's package name 4.The Google APIs Console responds by displaying Key for Android apps (with certificates) followed by a forty-character API key 5.Copy this key value 11 AIzaSyDZVhi1AFAqVN6djSpXLq36dvljPSeVFGU

S2-3. Adding the API Key to the Application 12 1.In AndroidManifest.xml, add the following element as a child of the element, by inserting it just before the closing tag : substituting your API key for your_api_key. This element sets the key com.google.android.maps.v2.API_KEY to the valueyour_api_key and makes the API key visible to any MapFragment in your application. MapFragment 2.Add the following elements to your manifest. Replace com.example.mapdemo with the package name of your application. 3.Save AndroidManifest.xml and re-build your application.