SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
developers
Re-engineering the Facebook SDK
          for Android
                            Connor Treacy
                           connor@fb.com
                           @connortreacy
In the last 30 days, Facebook sent users to
    Google Play & the Apple App Store
             174m times
1 Billion monthly active users
600M monthly active mobile users
  40% of the top 400 mobile apps
8 of the top 10 grossing mobile apps
Share           Drives
Stories          Traffic

          Your
          App
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
Post-SDK 2.0....
Android moved on



                      MyAppActivity
     !
    W
  NE




                         Activity



 Fragments         Activity Hierarchy   App Ecosystem
Facebook moved on




  Native App        Platform    App Install
Improvements        Stability     Traffic
Developers expected more
Objectives
1. Restructure for additive features

2. Native UI elements and Fragment support

3. Build features for high-value scenarios
Principles
1. Low-risk upgrage path from SDK 2.0

2. Feature parity with Facebook SDK for iOS

3. Better API stability
Facebook SDK for Android 3.0.1


    http://developers.facebook.com/android
Better Modularity


Native UI   LoginButton   FriendPickerFragment      ProfilePictureView


  Graph      Facebook
              GraphUser       GraphObject.Factory
                                             FacebookActivity
                                                        OpenGraphAction


    Core     Session      Request     UiLifecycleHelper      Settings
Better API interaction


                   RequestAsyncTask      RequestBatch



                             Facebook.request
                                  Request
     Your
     App                       FacebookError
                                  Response


                  FacebookException    FacebookRequestError


      FacebookAuthorizationException   FacebookServiceException
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);
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>
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)	
  {
                                     ...
                                     }
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);
Session Lifecycle

new Session()            CREATED_TOKEN_LOADED      session.open()




    valid       Yes                                                   OPENED
   cache?
                        OPENING
                                                                Yes
                                                     success?
      No

  CREATED             session.openFor…()
                                                         No


                                                CLOSED_LOGIN_FAILED
Session Lifecycle

   session.close()          CLOSED

                                       OPENED_TOKEN_UPDATED


      OPENED

                                                Yes
                                     success?

session.reauthorizeFor…()
                                         No


                                     OPENED
Feed Dialog
FriendPickerFragment   PlacePickerFragment
Growing your app
Growing your app




                   Settings.publishInstallAsync(...);
Facebook SDK 3.0.1
   for Android
developers.facebook.com/android

Contenu connexe

En vedette

Facebook connect tutorial
Facebook connect tutorialFacebook connect tutorial
Facebook connect tutorialJerry Wijaya
 
Build the future of mobile apps with facebook mobile app europe berlin sept 14
Build the future of mobile apps with facebook   mobile app europe berlin sept 14Build the future of mobile apps with facebook   mobile app europe berlin sept 14
Build the future of mobile apps with facebook mobile app europe berlin sept 14Julien Lesaicherre
 
Mobile Authentication for iOS Applications
Mobile Authentication for iOS ApplicationsMobile Authentication for iOS Applications
Mobile Authentication for iOS ApplicationsLindsay Brunner
 
The power of mobile advertising on facebook
The power of mobile advertising on facebookThe power of mobile advertising on facebook
The power of mobile advertising on facebookAndrey Podshibyakin
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdkSingsys Pte Ltd
 

En vedette (6)

Facebook connect tutorial
Facebook connect tutorialFacebook connect tutorial
Facebook connect tutorial
 
Build the future of mobile apps with facebook mobile app europe berlin sept 14
Build the future of mobile apps with facebook   mobile app europe berlin sept 14Build the future of mobile apps with facebook   mobile app europe berlin sept 14
Build the future of mobile apps with facebook mobile app europe berlin sept 14
 
Mobile Authentication for iOS Applications
Mobile Authentication for iOS ApplicationsMobile Authentication for iOS Applications
Mobile Authentication for iOS Applications
 
Facebook api for iOS
Facebook api for iOSFacebook api for iOS
Facebook api for iOS
 
The power of mobile advertising on facebook
The power of mobile advertising on facebookThe power of mobile advertising on facebook
The power of mobile advertising on facebook
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdk
 

Similaire à Droidcon2013 facebook sdk treacy

Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk Yi-Fan Chu
 
One graph to rule them all - Facebook
One graph to rule them all - FacebookOne graph to rule them all - Facebook
One graph to rule them all - Facebookitnig
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Yi-Fan Chu
 
Activities, Fragments, and Events
Activities, Fragments, and EventsActivities, Fragments, and Events
Activities, Fragments, and EventsHenry Osborne
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modulesomorandi
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPodsCocoaHeads France
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideVisual Engineering
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009eCommConf
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your appVitali Pekelis
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Matt Raible
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intentsVitali Pekelis
 
[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Android[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Androidrizki adam kurniawan
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataWaheed Nazir
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversJagdish Gediya
 

Similaire à Droidcon2013 facebook sdk treacy (20)

Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk
 
One graph to rule them all - Facebook
One graph to rule them all - FacebookOne graph to rule them all - Facebook
One graph to rule them all - Facebook
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk
 
Activities, Fragments, and Events
Activities, Fragments, and EventsActivities, Fragments, and Events
Activities, Fragments, and Events
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your app
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
 
[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Android[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Android
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 

Plus de Droidcon Berlin

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google castDroidcon Berlin
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility Droidcon Berlin
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_backDroidcon Berlin
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86Droidcon Berlin
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Droidcon Berlin
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkraussDroidcon Berlin
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014Droidcon Berlin
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidconDroidcon Berlin
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devicesDroidcon Berlin
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradioDroidcon Berlin
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon Berlin
 

Plus de Droidcon Berlin (20)

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google cast
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
crashing in style
crashing in stylecrashing in style
crashing in style
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility
 
Details matter in ux
Details matter in uxDetails matter in ux
Details matter in ux
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_back
 
droidparts
droidpartsdroidparts
droidparts
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86
 
5 tips of monetization
5 tips of monetization5 tips of monetization
5 tips of monetization
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkrauss
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidcon
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicro
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Droidcon2013 facebook sdk treacy

  • 1. developers Re-engineering the Facebook SDK for Android Connor Treacy connor@fb.com @connortreacy
  • 2. In the last 30 days, Facebook sent users to Google Play & the Apple App Store 174m times
  • 3. 1 Billion monthly active users 600M monthly active mobile users 40% of the top 400 mobile apps 8 of the top 10 grossing mobile apps
  • 4. Share Drives Stories Traffic Your App
  • 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
  • 7. Android moved on MyAppActivity ! W NE Activity Fragments Activity Hierarchy App Ecosystem
  • 8. Facebook moved on Native App Platform App Install Improvements Stability Traffic
  • 10.
  • 11.
  • 12. Objectives 1. Restructure for additive features 2. Native UI elements and Fragment support 3. Build features for high-value scenarios
  • 13. Principles 1. Low-risk upgrage path from SDK 2.0 2. Feature parity with Facebook SDK for iOS 3. Better API stability
  • 14. Facebook SDK for Android 3.0.1 http://developers.facebook.com/android
  • 15. Better Modularity Native UI LoginButton FriendPickerFragment ProfilePictureView Graph Facebook GraphUser GraphObject.Factory FacebookActivity OpenGraphAction Core Session Request UiLifecycleHelper Settings
  • 16. Better API interaction RequestAsyncTask RequestBatch Facebook.request Request Your App FacebookError Response FacebookException FacebookRequestError FacebookAuthorizationException FacebookServiceException
  • 17. 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);
  • 18. 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>
  • 19. 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)  { ... }
  • 20. 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);
  • 21. Session Lifecycle new Session() CREATED_TOKEN_LOADED session.open() valid Yes OPENED cache? OPENING Yes success? No CREATED session.openFor…() No CLOSED_LOGIN_FAILED
  • 22. Session Lifecycle session.close() CLOSED OPENED_TOKEN_UPDATED OPENED Yes success? session.reauthorizeFor…() No OPENED
  • 24. FriendPickerFragment PlacePickerFragment
  • 26. Growing your app Settings.publishInstallAsync(...);
  • 27. Facebook SDK 3.0.1 for Android developers.facebook.com/android