2. 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
3. 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
4. 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
6. Helper methods
● Always check for availability first!
● Use isGooglePlayServicesAvailable() in
onResume
● Give the user a chance to install the missing
file with getErrorDialog()
● getOpenSourceSoftwareLicenseInfo()
8. 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
11. 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
15. 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
16. 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
18. PlusShare: Share Content
● Simple share intent
PlusShare.Builder.getIntent()
● Deep linking
setContentDeepLinkId()
setContentUrl()
● Interactive posts
addCallToAction()
● Can be ActionBar or (standard) Button
● Breaks ShareActionProvider
19. 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());
20. 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
21. Over-the-air install (7 March)
● Setup web client
● Sign-in Button + app package name
● Quality control by
Google (?)
28. 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
30. 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...