Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Similar documents
Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Lecture 13 Mobile Programming. Google Maps Android API

Google Maps Troubleshooting

Lab 6: Google Maps Android API v2 Android Studio 10/14/2016

Obtaining a Google Maps API Key. v1.0. By GoNorthWest. 15 December 2011

From time to time Google changes the way it does things, and old tutorials may not apply to some new procedures.

Google Maps library requires v2.50 or above.

CS371m - Mobile Computing. Maps

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Login with Amazon. Getting Started Guide for Android apps

Lifecycle Callbacks and Intents

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Mobile Application Development Google Maps Android API

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

Introduction to Android development

Message Passing & APIs

Signing For Development/Debug

Abusing Android In-app Billing feature thanks to a misunderstood integration. Insomni hack 18 22/03/2018 Jérémy MATOS

Lifecycle-Aware Components Live Data ViewModel Room Library

AppsFlyer SDK Integration - Android V 4.5.0

AppsFlyer SDK Integration - Android V

Manual Android Virtual Device Failed To Load Click Details

IEMS 5722 Mobile Network Programming and Distributed Server Architecture

BlackBerry Developer Global Tour. Android. Table of Contents

Android InsecureBankv2 Usage Guide. InsecureBankv2

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Programming with Android: The Google Maps Library. Slides taken from

XML Tutorial. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project.

Lab Android Development Environment

PILOT FM Radio SDK AUGUST 31, 2016

Android Studio is google's official IDE(Integrated Development Environment) for Android Developers.

Tutorial on OpenCV for Android Setup

Android Application Development using Kotlin

Understanding Application

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

CS378 -Mobile Computing. Maps

ArcGIS Runtime SDK for Android: Building Apps. Shelly Gill

UNDERSTANDING ACTIVITIES

Hello World. Lesson 1. Create your first Android. Android Developer Fundamentals. Android Developer Fundamentals

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

Lab 1: Getting Started With Android Programming

BlackBerry Developer Summit. A02: Rapid Development Leveraging BEMS Services and the AppKinetics Framework

Manual Android Virtual Device Failed To Load Error

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

Steps to Set Up the Environment of Xamarin in Visual

Geo Catching Sprint #3 Kick-off

CS371m - Mobile Computing. Persistence - Web Based Storage CHECK OUT g/sync-adapters/index.

Mobile Programming Lecture 1. Getting Started

COLLEGE OF ENGINEERING, NASHIK-4

CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L

Mobile Application Development Integration HTTP Android Client (Retrofit)

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Software Development Kit for ios and Android

Overview of Activities

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

ATC Android Application Development

How to customise and what you need to change

This walkthrough assumes you have completed the Getting Started walkthrough and the first lift and shift walkthrough.

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu

Choose OS and click on it

Accessibility. Adding features to support users with impaired vision, mobility, or hearing

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu

Serverless Single Page Web Apps, Part Four. CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016

Android App Development

1.00 Lecture 2. What s an IDE?

Minds-on: Android. Session 1

ipass SmartConnect Getting Started Guide for Android Version MARCH 2017

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

How to Set up Eclipse and Android SDK Manager Environment You need to download the following

Mission Guide: Google Apps

Fragments and the Maps API

Introduction to Android

(Refer Slide Time: 1:07)

PowerExchange for Facebook: How to Configure Open Authentication using the OAuth Utility

Getting Started with Android Development Zebra Android Link-OS SDK Android Studio

ArcGIS Runtime SDK for Android An Introduction. Xueming

Android Essentials with Java

HOW TO DEVELOP FOR GLASS ENTERPRISE

WP Voting Plugin - Ohiowebtech Video Extension - Youtube Documentation

Firebase Essentials. Android Edition

Android About.me/DavidCorrado Mobile Meetup Organizer

ANDROID SYLLABUS. Advanced Android

(Refer Slide Time: 1:12)

Sticky Notes for Cognos Analytics by Tech Data BSP Software

Developing Solutions for Google Cloud Platform (CPD200) Course Agenda

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Activity Logging Lecture 16

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Homework 9: Stock Search Android App with Facebook Post A Mobile Phone Exercise

Learning vrealize Orchestrator in action V M U G L A B

ConstraintLayouts in Android

Real-Time Embedded Systems

Tutorial on OpenCV for Android Setup

Impressory Documentation

Android for Ubiquitous Computing Researchers. Andrew Rice University of Cambridge 17-Sep-2011

Programming Mobile Applications with Android Lab2

STORE LOCATOR PLUGIN USER GUIDE

Cupid Documentation. Release 0.2 (ESMF v7) Rocky Dunlap

Copyright & trademark info

ODDS (Olympus Dictation Delivery Service) Setup

Android Programming in Bluetooth Cochlea Group

Transcription:

Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie

Android Google Services" Part 1 Google+ Sign-in 2!

Google Services Overview * Overview of Google Play Services and Setup Detailed look at Google+ Sign-in and Authentication (Part 1) Location & Geocoding (Part 2) Google Maps (Part 3) 3!

Google Services Overview Overview of Google Play Services and Setup Detailed look at Google+ Sign-in and Authentication (Part 1) 4!

General Overview What is it? Google Play Services is "a single place that brings in all of Google's APIs on Android 2.2 and above." With Google Play Services, your app can take advantage of the latest, Google-powered features such as Maps, Google+, and more, with automatic platform updates distributed as an APK through the Google Play store. This makes it faster for users to receive updates and easier for developers to integrate the newest that Google has to offer. 5!

Overview How it Works (Google Play Services) The Google Play services APK on user devices receives regular updates for new APIs, features, and bug fixes. 6!

Overview How it Works (Google API Client) 7!

Overview What You Get https://developers.google.com/android/guides/overview! 8!

Setting Up! Google Play Services! 9!

Download Google Play Services (Android SDK Manager) Slide 10!

Setting Up Google Play Services" (https://developer.android.com/google/play-services/setup.html) Make sure that the Google Play services SDK is installed, as shown on the previous slide. Create an application using Android Studio. In Android Studio under Gradle Scripts, edit the build.gradle file for Module: app " (not the build.gradle file for the project) Under dependencies (near the bottom), add the following line at the end: compile 'com.google.android.gms:play-services-location:9.8.0' Save the changes and click Sync Project with Gradle Files toolbar, or click on menu item" Tools g Android g Sync Project with Gradle Files. in the 11!

Setting Up Google Play Services (continued) When we re finished CoffeeMate, our dependencies will look something like this (version numbers may differ) 12!

Setting Up Google Play Services (continued) Edit file AndroidManifest.xml and add the following tag as a child of the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> Note: You can ignore instructions about creating a ProGuard! exception if you are building in debug mode (i.e., not release mode).! 13!

Testing Google Play Services To test an application using the Google Play services SDK, you must use either A compatible Android device that runs Android 2.3 or higher and includes Google Play Store An Android emulator (virtual device) that runs the Google APIs platform based on Android 4.2.2 or higher (Genymotion is a good one to use Part 2) 14!

Popular APIs (100+ in total) * Slide 15!

Popular APIs (100+ in total) * Slide 16!

Part 1! Google+ Sign-in! 17!

Introduction With the Google+ Platform for Android, you can allow application users to sign in with their existing Google+ accounts. It helps you in knowing your end users and providing them with a better enriched experience in your application. As soon as a user allows your app to use Google+ Sign In, you can easily get info about the user and people in the users circles. You can also get access to post on Google+ on the users behalf. Overall, it is quick and easy way to engage end users in your application. 18!

Google+ Sign-in Requirements For integrating Google+ Sign-in into your Android Application, we need to complete the following : 1. Enable Google+ API on The Developers Console and create credentials for your application authentication 2. Configuring Google Play Services in Android Studio 3. Create your Android Application with Google+ Sign-in 19!

1. Enable Google+ API on The Developers Console 1 Go to Google Developers Console 2 If you don t have any existing projects, Create Project. 3 Select your project and choose ENABLE API on the menu. 4 Browse for Google+ API (under Social APIs) and turn ON its status by accepting terms and conditions. Do not close developers console yet, you ll still use it to generate your authentication key in the next few steps. 20!

1. Enable Google+ API on The Developers Console 21!

1. Enable Google+ API on The Developers Console 5 Generate your SHA1 fingerprint 1. You can either use the java keytool utility, like so keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android 22!

1. Enable Google+ API on The Developers Console 5 Generate your SHA1 fingerprint 1. You can 1. Click on your package and choose New -> Google -> Google Maps Activity 2. Android Studio redirects you to google_maps_api.xml with your SHA1 This gives you A LOT of extra bolierplate code that you might not even need (if you re not using maps) 23!

1. Enable Google+ API on The Developers Console 5 Generate your SHA1 fingerprint 1. Or you can 1. Open/View Your Project 2. Click on Gradle (From Right Side Panel, you will see Gradle Bar) 3. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project) 4. Click on Your Project (Your Project Name from List (root)) 5. Click on Tasks 6. Click on android 7. Double Click on signingreport (You will get SHA1 and MD5 in Run Bar)" This is probably the simplest approach with minimal fuss! IMHO 24!

1. Enable Google+ API on The Developers Console 25!

1. Enable Google+ API on The Developers Console 6 Navigate to Credentials -> Create Credentials -> API Key -> Android Key, 7 It will ask to Configure consent screen if not configured before. Fill in the necessary information and save. It will redirect you back to the creation page. 8 Give your Key a Name and Add package name and fingerprint 9 Enter your package name and your SHA1 fingerprint (generated previously) and click Create You now have your API Key which you can use in your Android Apps to use the Google APIs 26!

1. Enable Google+ API on The Developers Console 27!

1. Enable Google+ API on The Developers Console 28!

2. Configure Google Play Services Already Done! (from previous slides ) 29!

3. Create your Android App (CoffeeMate) You ll cover this in the Labs, but we ll have a look at some of the code next 30!

Steps in Integrating Google Sign-In into your App Import classes/interfaces. Declare that the activity implements callback interfaces. Declare/build GoogleApiSignInOptions object Declare/build GoogleApiClient object. Implement callback interfaces. Implement methods onstart() and onstop() (and possibly other lifecycle methods such as onpause()" and onresume()) to gracefully handle connections to Google Play Services 31!

Integrating Google Sign-In into Your Android App https://developers.google.com/identity/sign-in/android/sign-in!! 32!

Configure Google Sign-In & GoogleApiClient object 33!

Configure Google Sign-In & GoogleApiClient object * 34!

Aside Connecting to Google Drive Example * 35!

Add the Google Sign-In button to your app * 36!

Start the sign-in flow 37!

Start the sign-in flow 38!

Start the sign-in flow 39!

Start the sign-in flow * 40!

Key Interfaces/Classes for Google Sign-In" (in package com.google.android.gms.auth.api.signin) GoogleSignInAccount GoogleSignInOptions.Builder 41!

Key Interfaces/Classes for Google Sign-In" (in package com.google.android.gms.common.api) GoogleApiClient GoogleApiClient.Builder 42!

Key Interfaces/Classes for Google Sign-In" (in package com.google.android.gms.common.api) GoogleApiClient.ConnectionCallbacks GoogleApiClient.OnConnectionFailedListener 43!

Key Interfaces/Classes for Google Sign-In" (in package com.google.android.gms.common.api) GoogleApiClient main entry point for Google Play services integration GoogleApiClient.ConnectionCallbacks provides callbacks that are called when the client is connected or disconnected from the service abstract methods: void onconnected(bundle connectionhint) void onconnectionsuspended(int cause) GoogleApiClient.OnConnectionFailedListener provides callbacks for scenarios that result in a failed attempt to connect the client to the service abstract method: void onconnectionfailed(connectionresult result) 44!

CoffeeMate 5.0 Code Highlights 45!

CoffeeMateApp (Application) * Here we declare our GoogleSignInOptions and GoogleApiClient references (and other variables) to store users Google+ info. We populate these objects in our Login process. Volley Request Queue also set up here (see the labs for further details). 46!

Login (Activity) * Our Login Activity implements the relevant interfaces Here we Build our sign in options 47!

Login (Activity) * Build our client with the specific sign in options and the APi we want to use - (Google Sign-In) Try and sign in to Google 48!

Login (Activity) * If sign in result ok, handle it. On successful sign in, get the users Google info Take the user to the Home screen 49!

CoffeeFragment (extracts) * Setting up our Swipe Refresh Retrieving all the coffees from the server 50!

CoffeeFragment (extracts) * Attach listener & retrieve coffees Detach listener Do we need getall( ) on the previous slide? 51!

CoffeeFragment (extracts) * Deleting a single coffee 52!

CoffeeFragment (extracts) * Deleting multiple coffees 53!

Add (Fragment) * Creating a new coffee object Note the extra Google parameters Updating our coffee data on the server 54!

Edit (Fragment) * ID passed from List (now a string value) Retrieving coffee data from server Saving our coffee data to the server 55!

CoffeeMate 5.0+ 56!

Relevant Links Setting Up Google Play Services https://developer.android.com/google/play-services/setup.html Integrating Google+ Sign In into your Android Application" http://androidsrc.net/integrating-google-plus-sign-in-into-your-android-application/ Official Docs https://developers.google.com/identity/sign-in/android/sign-in 57!

Questions?! 58!