Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Google I/O 2016 - Firebase by Laurence de Villers

Google I/O 2016 - Firebase by Laurence de Villers


GDG Montreal

June 30, 2016


  1. Laurence de Villers +LaurencedeVillers THE BIGGEST ANNOUNCEMENT OF I/O

  2. Daydream ALLO DUO Instant APP Solid

  3. Coming in Fall 2016

  4. 30% of the conferences of Google I/O was about

  5. None
  6. None
  7. None
  8. None
  9. Cost = 5$ per hour per real device

  10. None
  11. Confidential © 2016 Busbud Inc. How we used Firebase to

    ship Busbud mobile app features 10x Faster
  12. Confidential © 2016 Busbud Inc. Earlier access before Google I/O

    to Firebase “When Busbud got access to Firebase, we were immediately impressed by the loads of features and services to play with. We were literally grinning like kids in a candy store! And with a simplified SDK and a turnkey Console, these new features and services work even better together!”
  13. Confidential © 2016 Busbud Inc. Feature at Google I/O

  14. Confidential © 2016 Busbud Inc. Advantages Takeaways Takeaway #1: The

    integrated approach used in Firebase helps you quickly assemble new functionality within your apps with minimal engineering work. Takeaway #2: Firebase lets you focus on solving more of your customers’ problems. Takeaway #3: A unified Firebase Analytics lets you make smart, data-driven decisions.
  15. Confidential © 2016 Busbud Inc. Tools and features use in

    Busbud application
  16. Confidential © 2016 Busbud Inc. Base configuration Simple :) Gradle

    Root Level Gradle Module Level
  17. Confidential © 2016 Busbud Inc. Crash Reporting Fatal Crash Just

    need to add this: com.google.firebase:firebase-crash:9.x.x Non-Fatal Crash FirebaseCrash.log("Cart creation exception catched"); FirebaseCrash.report(throwable); Log is use to have more context about this non-fatal crash.
  18. Confidential © 2016 Busbud Inc. Analytics Basic tracking: com.google.firebase:firebase-measurement:9.x.x Custom

    Data: FirebaseAnalytics.getInstance(context).logEvent (String evenName, Bundle properties) Note: The event can be stored and queried in BigQuery
  19. Confidential © 2016 Busbud Inc. Analytics Quick tip Quick tip,

    use different gradle flavor Firebase configuration is based on the package name and signing SHA-1, but several apps can cohabitate easily within the same Firebase project. Make sure to differentiate between features that are shared within the same project (FCM, Remote Config) and ones that are split between apps (Analytics, Crash).
  20. Confidential © 2016 Busbud Inc. Remote Config This is the

    feature key to experiment within your app. Ship faster with less risk.
  21. Confidential © 2016 Busbud Inc. Remote Config Apply conditions on

    criteria You can apply conditions on those configuration to distribute different values depending on many criteria: • Countries • Languages • Package names • Random % of users • And more
  22. Confidential © 2016 Busbud Inc. Remote Config Code FirebaseRemoteConfig firebaseRemoteConfig

    = FirebaseRemoteConfig.getInstance(); //Enabling developer mode to get more request per hour FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder() .setDeveloperModeEnabled(BuildConfig.DEBUG) .build(); firebaseRemoteConfig.setConfigSettings(configSettings); compile 'com.google.firebase:firebase-config:9.x.x'
  23. Confidential © 2016 Busbud Inc. Remote Config Code //Fetching data

    from the config. firebaseRemoteConfig.fetch(cacheExpiration) .addOnSuccessListener(aVoid -> { firebaseRemoteConfig.activateFetched(); long version = firebaseRemoteConfig.getLong(Constants.RemoteConfigKeys.ANDROID_VERSION_CODE_MIN); mPrefs.edit() .putLong(SharedPreferences.Version.VERSION_CODE_MIN, version) .apply(); }) .addOnFailureListener(throwable -> { if (BuildConfig.IS_LOG_DEBUG) { Log.d(LOG_TAG, "Fetch Failed"); } });
  24. Confidential © 2016 Busbud Inc. Push Notifications We were able

    to send, receive and see push notification in 3 minutes ! Simple Notification: com.google.firebase:firebase-messaging:9.0.2 • FCM allows many levels of customization: ◦ You can use HTTP/XMPP request in the SDK
  25. Confidential © 2016 Busbud Inc. Push Notifications Can customize data

    with a custom payload, subscribe to topics and send notification: { "to": "/topics/debug_9q8yyk_9q5ctr", "data": { "bb_type": "new_route", "bb_from": "9q8yyk", "bb_to": "9q5ctr" } }
  26. Confidential © 2016 Busbud Inc. Realtime Database Realtime Database is

    the perfect place to experiment when you need to store or retrieve static data from the network. You can store JSON files that are synced to your device so they remain available even when offline. You can upload data from the app to the DB. All the data is stored in JSON format.
  27. Confidential © 2016 Busbud Inc. TestLabs TestLabs is not a

    new feature, but Firebase provides a nice console to browse your tests results. You can run the test from Android Studio. You can see the logs and video of the test sessions afterwards.
  28. Confidential © 2016 Busbud Inc. Firebase: more efficient mobile development

    for all! The launch of Firebase is a welcome addition to the mobile development community. Android, iOS and Javascript SDK. After only a few months working with Google Firebase, we successfully shipped high quality features much faster than we expected— sometimes 10x faster than what we had planned!
  29. Confidential © 2016 Busbud Inc. Questions ?

  30. Confidential © 2016 Busbud Inc.