Google Integration in Android Apps - Mooscon 2013 Cebit
Upcoming SlideShare
Loading in...5
×
 

Google Integration in Android Apps - Mooscon 2013 Cebit

on

  • 762 views

 

Statistics

Views

Total Views
762
Views on SlideShare
762
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Google Integration in Android Apps - Mooscon 2013 Cebit Google Integration in Android Apps - Mooscon 2013 Cebit Presentation Transcript

  • Google Integration in Android Apps Ronan Schwarz and Friedger Müffke Moosecon - 8 March 2013
  • Android and Google ● Android Open Source Project (AOSP) all, cheap, free ● Open Handset Alliance 84 companies, Google governance ● Android Update Alliance promise to update ● Google User Experience CTS and relevance
  • Google for developers so far ● Some Content Provider API, e.g. calendar contract ● Intents to launch apps e.g. Navigation ● Java libs and Web APIs e.g gdata client lib to connect to Google Docs View slide
  • Google Play Framework (gms) ● Requires Android 2.2 and Google Play ● APK that provides APIs to Google services ● Service APK will and must be installed automatically View slide
  • Google Play Framework (gms) Requires real device
  • Helper methods ● Always check for availability first! ● Use isGooglePlayServicesAvailable() in onResume ● Give the user a chance to install the missing file with getErrorDialog() ● getOpenSourceSoftwareLicenseInfo()
  • Authentication http://www.flickr.com/photos/carlosluzz/
  • Authentication ● OAuth2 through GoogleAuthToken class ● get the Google Account(s) by ○ AccountManager ○ AccountPicker.newIntent() ● Email needed for retrieving auth token ● getToken() for UI components ● getTokenWithNotification() for Services
  • Authentication Error Handling ● User Recoverable Error ○ UserRecoverableAuthException ○ GooglePlayServicesAvailabilityException ○ UserRecoverableNotifiedException ● Non-Recoverable Error ○ GoogleAuthException
  • Google Plus
  • Google Plus ● Updated on 26 February 2013 ● Policy ○ not to misuse personal data and +1 links ○ only use Google provided branding ○ provide means to revoke authorization
  • Google Plus: Setup Services OAuth2 client
  • Google Plus: Setup Identify each client
  • PlusClient: initialize PlusClient.Builder()...build() PlusClient.connected() and .disconnected() within component lifecycle All calls are asyncronous .onConnected() and . onDisconnected()
  • PlusClient: Sign-In ● Visual user consent <com.google.android.gms. common.SignInButton android:id="@+id/sign_in_button" android:layout_width="wrap_content" android:layout_height="wrap_content" /> ● startResolutionForResult() on click ● optional sign-out button ● required revoke method with deletion of data
  • PlusClient: Social Graph ● Profile of the user mPlusClient.loadPerson(this, "me"); // or "108591961893121462921" ● People in the circles of the user mPlusClient.loadPeople(this, Person.Collection.VISIBLE); ● Email address (PlusClient.getAccountName()) requires additional permission GET_ACCOUNTS
  • PlusClient: App Activities AddActivity BuyActivity CheckInActivity CommentActivity CreateActivity DiscoverActivity ListenActivity ReserveActivity ReviewActivity WantActivity ● Moments: "possibility to share what user has done in the app" ● Prepare snippet (or let prepare) ● writeMoment(moment) ● removeMoement(moment)
  • PlusShare: Share Content ● Simple share intent PlusShare.Builder.getIntent() ● Deep linking setContentDeepLinkId() setContentUrl() ● Interactive posts addCallToAction() ● Can be ActionBar or (standard) Button ● Breaks ShareActionProvider
  • PlusShare: Deep Linking ● Intent filter in Manifest <activity android:name=".ParseDeepLinkActivity"> <intent-filter> <action android:name="com.google.android.apps.plus.VIEW_DEEP_LINK" /> <data android:scheme="vnd.google.deeplink" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity> ● Extract deep link id PlusShare.getDeepLinkId(this.getIntent());
  • PlusOneButton: Recommendations ● Add a +1 Button to anything <com.google.android.gms.plus.PlusOneButton xmlns:plus= "http://schemas.android.com/apk/lib/com.google.android.gms.plus" plus:size="standard"/> ● One URL per button mPlusOneButton.initialize(mPlusClient, URL); ● No Meta-Data
  • Over-the-air install (7 March) ● Setup web client ● Sign-in Button + app package name ● Quality control by Google (?)
  • Google Maps: V2
  • Google Maps: V2 ● Fragments! ● Fragments for older Devices! ● Views! ● Activities ? ● Breaks compatibility.
  • Google Maps: Camera ● 2-Axis Rotation ● Perspective View ● Zoom ● Move ● Target
  • Google Maps: Markers ● Default Markers ● Customize Appearance ● Show InfoWindow ● InfoWindow != View ● Add/Remove Markers manually
  • Google Maps: Custom Drawing ● Lines ● Circles ● Polygons ● Points are Lat,Long points Polygon polygon = map.addPolygon( new PolygonOptions() .add(new LatLng(0, 0), new LatLng(0, 5), new LatLng(3, 5)) .strokeColor(Color.RED) .fillColor(Color.BLUE));
  • Goodies http://www.flickr.com/photos/g-alain/
  • ImageManager ● Load Images from an external resource in the background ● Can specify a default resource for errors etc ● As easy as loadImage(ImageView,Uri,defaultResId) ● Only G+ URL's ● For everything else use the novoda ImageLoader on github.com/novoda
  • PanoramaClient ● Load from URL ● Load from ContentProvider ● Zoom and Rotate
  • Hints ● Debug adb shell setprop log.tag.GooglePlusPlatform VERBOSE ● Lot's of example codes and documentation at https://developer.android.com/google/play-services/index.html ● G+ Bootcamp for companies http://googleplusplatform.blogspot.de/2013/03/global-google-sign-in-bootcamps. html Berlin, Germany - March 18th - March 22nd More to come...
  • Questions Ronan Schwarz Friedger Müffke novoda.com @novoda #moosecon