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.

Lifecycle Callbacks and Intents

Mobile Application Development Google Maps Android API

CS371m - Mobile Computing. Maps

Login with Amazon. Getting Started Guide for Android apps

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

Signing For Development/Debug

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

AppsFlyer SDK Integration - Android V 4.5.0

AppsFlyer SDK Integration - Android V

Introduction to Android development

Message Passing & APIs

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

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

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

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

Lab Android Development Environment

IEMS 5722 Mobile Network Programming and Distributed Server Architecture

Manual Android Virtual Device Failed To Load Click Details

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

Tutorial on OpenCV for Android Setup

Lifecycle-Aware Components Live Data ViewModel Room Library

PILOT FM Radio SDK AUGUST 31, 2016

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

UNDERSTANDING ACTIVITIES

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

Lab 1: Getting Started With Android Programming

Manual Android Virtual Device Failed To Load Error

Geo Catching Sprint #3 Kick-off

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

Steps to Set Up the Environment of Xamarin in Visual

Mobile Programming Lecture 1. Getting Started

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

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

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Overview of Activities

Software Development Kit for ios and Android

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.

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

Choose OS and click on it

CS378 -Mobile Computing. Maps

ArcGIS Runtime SDK for Android: Building Apps. Shelly Gill

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

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

ipass SmartConnect Getting Started Guide for Android Version MARCH 2017

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

Android Application Development using Kotlin

Mission Guide: Google Apps

Introduction to Android

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

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

(Refer Slide Time: 1:07)

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

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

WP Voting Plugin - Ohiowebtech Video Extension - Youtube Documentation

Understanding Application

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

(Refer Slide Time: 1:12)

Sticky Notes for Cognos Analytics by Tech Data BSP Software

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

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

Real-Time Embedded Systems

ConstraintLayouts in Android

COLLEGE OF ENGINEERING, NASHIK-4

1.00 Lecture 2. What s an IDE?

ATC Android Application Development

Tutorial on OpenCV for Android Setup

Programming Mobile Applications with Android Lab2

STORE LOCATOR PLUGIN USER GUIDE

Minds-on: Android. Session 1

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

CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing. Lab & Demo 2 (Part 1-2) Hello-Goodbye App Tutorial

ODDS (Olympus Dictation Delivery Service) Setup

Firebase Essentials. Android Edition

When providing a native mobile app ruins the security of your existing web solution. CyberSec Conference /11/2015 Jérémy MATOS

How To Run Mobi Ready

After you create a new project you should be able to access the below windows:

Genymotion Cloud User Guide

CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing. Lab & Demo 2 (1 &2 of 3) Hello-Goodbye App Tutorial

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

With Jem Matcher working on PC, we can finally set up

Mobile and Social Computing

HOW TO DEVELOP FOR GLASS ENTERPRISE

USER GUIDE FOR SMARTPHONE BASED REAL-TIME ACOUSTIC FEEDBACK CANCELLATION SYSTEM

Integrating YuJa Active Learning into Google Apps via SAML

1. SUPPORT PLATFORMS 2. INSTALLATION GUIDE Install Android SDK

Securing U2 Soap Server

Google SAML Integration

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

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

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

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 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 The Google Play services APK on user devices receives regular updates for new APIs, features, and bug fixes. 6!

Overview https://developers.google.com/android/guides/overview! 7!

Setting Up! Google Play Services! 8!

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

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:8.1.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 10!

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

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).! 12!

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) 13!

Part 1! Google+ Sign-in! 14!

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. 15!

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 16!

1. Enable Google+ API on The Developers Console Go to Google Developers Console If you don t have any existing projects, Create Project. Select your project and choose ENABLE API on the menu. 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. 17!

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

1. Enable Google+ API on The Developers Console 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 19!

1. Enable Google+ API on The Developers Console 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) 20!

1. Enable Google+ API on The Developers Console 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 21!

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

1. Enable Google+ API on The Developers Console Navigate to Credentials -> Create Credentials -> API Key -> Android Key, 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. Give your Key a Name and Add package name and fingerprint 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 23!

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

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

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

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 27!

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 28!

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

Configure Google Sign-In & GoogleApiClient object 30!

Configure Google Sign-In & GoogleApiClient object 31!

Add the Google Sign-In button to your app 32!

Start the sign-in flow 33!

Start the sign-in flow 34!

Start the sign-in flow 35!

Start the sign-in flow 36!

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

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

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

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) 40!

CoffeeMate 5.0 Code Highlights 41!

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. 42!

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

Login (Activity) Build our client with the specific sign in options and the APi we want to use. Try and sign in to Google 44!

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 45!

CoffeeMate 5.0+ 46!

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 47!

Questions?! 48!