Your SlideShare is downloading. ×
0
developersRe-engineering the Facebook SDK          for Android                            Connor Treacy                   ...
In the last 30 days, Facebook sent users to    Google Play & the Apple App Store             174m times
1 Billion monthly active users600M monthly active mobile users  40% of the top 400 mobile apps8 of the top 10 grossing mob...
Share           DrivesStories          Traffic          Your          App
Android versions over time                                                                                          Source...
Post-SDK 2.0....
Android moved on                      MyAppActivity     !    W  NE                         Activity Fragments         Acti...
Facebook moved on  Native App        Platform    App InstallImprovements        Stability     Traffic
Developers expected more
Objectives1. Restructure for additive features2. Native UI elements and Fragment support3. Build features for high-value s...
Principles1. Low-risk upgrage path from SDK 2.02. Feature parity with Facebook SDK for iOS3. Better API stability
Facebook SDK for Android 3.0.1    http://developers.facebook.com/android
Better ModularityNative UI   LoginButton   FriendPickerFragment      ProfilePictureView  Graph      Facebook              ...
Better API interaction                   RequestAsyncTask      RequestBatch                             Facebook.request  ...
Initializing with the SDK 2.0‣ Instantiate the Facebook object with your App ID‣ Most activity managed from the Facebook o...
Initializing with the SDK 3.0‣ Greater separation of concerns: Session, Request, Response, UI elements‣ Set up the App ID ...
Activity Lifecycle with SDK 2.0‣ Extend the FacebookActivity class‣ Handle session state changes by overriding the abstrac...
Activity Lifecycle with SDK 3.0‣ Keep your own Activities‣ Instantiate a UiLifeCycleHelper and keep it in step with your A...
Session Lifecyclenew Session()            CREATED_TOKEN_LOADED      session.open()    valid       Yes                     ...
Session Lifecycle   session.close()          CLOSED                                       OPENED_TOKEN_UPDATED      OPENED...
Feed Dialog
FriendPickerFragment   PlacePickerFragment
Growing your app
Growing your app                   Settings.publishInstallAsync(...);
Facebook SDK 3.0.1   for Androiddevelopers.facebook.com/android
Droidcon2013 facebook sdk treacy
Droidcon2013 facebook sdk treacy
Upcoming SlideShare
Loading in...5
×

Droidcon2013 facebook sdk treacy

574

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
574
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Droidcon2013 facebook sdk treacy"

  1. 1. developersRe-engineering the Facebook SDK for Android Connor Treacy connor@fb.com @connortreacy
  2. 2. In the last 30 days, Facebook sent users to Google Play & the Apple App Store 174m times
  3. 3. 1 Billion monthly active users600M monthly active mobile users 40% of the top 400 mobile apps8 of the top 10 grossing mobile apps
  4. 4. Share DrivesStories Traffic Your App
  5. 5. Android versions over time Source: bgr.com 4.1 Jellybean 100 4 Ice Cream 3 Honeycomb 80 2.3 Gingerbread 2.2 Froyo 2.1 Eclair 60 2.0 1.6 Donut 1.5 Cupcake 40 Dec 2009 20 June 2010 Dec 2010 June 2011 Dec 2011 SDK 1.0 June 2012 0 Dec 2012 SDK 3.0 SDK 3.0
  6. 6. Post-SDK 2.0....
  7. 7. Android moved on MyAppActivity ! W NE Activity Fragments Activity Hierarchy App Ecosystem
  8. 8. Facebook moved on Native App Platform App InstallImprovements Stability Traffic
  9. 9. Developers expected more
  10. 10. Objectives1. Restructure for additive features2. Native UI elements and Fragment support3. Build features for high-value scenarios
  11. 11. Principles1. Low-risk upgrage path from SDK 2.02. Feature parity with Facebook SDK for iOS3. Better API stability
  12. 12. Facebook SDK for Android 3.0.1 http://developers.facebook.com/android
  13. 13. Better ModularityNative UI LoginButton FriendPickerFragment ProfilePictureView Graph Facebook GraphUser GraphObject.Factory FacebookActivity OpenGraphAction Core Session Request UiLifecycleHelper Settings
  14. 14. Better API interaction RequestAsyncTask RequestBatch Facebook.request Request Your App FacebookError Response FacebookException FacebookRequestError FacebookAuthorizationException FacebookServiceException
  15. 15. Initializing with the SDK 2.0‣ Instantiate the Facebook object with your App ID‣ Most activity managed from the Facebook object fbconnection  =  new  Facebook("1123581321"); fbconnection.authorize(          getActivity(),            new  String[]  ("publish_actions",  “user_likes”),              dialogListener);
  16. 16. Initializing with the SDK 3.0‣ Greater separation of concerns: Session, Request, Response, UI elements‣ Set up the App ID through the string resources and Android Manifest files <string  name="app_id">480369938658210</string> ...        <meta-­‐data              android:name="com.facebook.sdk.ApplicationId"                android:value="@string/app_id"  /> </application>
  17. 17. Activity Lifecycle with SDK 2.0‣ Extend the FacebookActivity class‣ Handle session state changes by overriding the abstract method in FacebookActivity public  class  MainActivity  extends  FacebookActivity  { @Override protected  void  onSessionStateChange(    SessionState  state,  Exception  exception)  { ... }
  18. 18. Activity Lifecycle with SDK 3.0‣ Keep your own Activities‣ Instantiate a UiLifeCycleHelper and keep it in step with your Activity public  class  MainActivity  extends  WhateverYouWantActivity  { @Override public  void  onCreate(Bundle  savedInstanceState)  {        super.onCreate(savedInstanceState);        uiHelper  =  new  UiLifecycleHelper(this,  callback);        uiHelper.onCreate(savedInstanceState);
  19. 19. Session Lifecyclenew Session() CREATED_TOKEN_LOADED session.open() valid Yes OPENED cache? OPENING Yes success? No CREATED session.openFor…() No CLOSED_LOGIN_FAILED
  20. 20. Session Lifecycle session.close() CLOSED OPENED_TOKEN_UPDATED OPENED Yes success?session.reauthorizeFor…() No OPENED
  21. 21. Feed Dialog
  22. 22. FriendPickerFragment PlacePickerFragment
  23. 23. Growing your app
  24. 24. Growing your app Settings.publishInstallAsync(...);
  25. 25. Facebook SDK 3.0.1 for Androiddevelopers.facebook.com/android
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×