Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Building the Fabric SDKs - #MBLTDev (30 min)
Search
Ty Smith
October 28, 2014
Programming
240
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building the Fabric SDKs - #MBLTDev (30 min)
Ty Smith
October 28, 2014
Transcript
47 slides
dev.twitter.com @tsmith Building the Fabric SDKs Ty Smith Sr. Android
Engineer
None
None
None
None
Fabric Sample App Cannonball Open source for iOS & Android:
github.com/twitterdev
Powerful Lightweight
Powerful
Ease of Integration
Ease of Integration Fabric.with(this, new Crashlytics());
Extensible
Extensible Crashlytics.start(this);
Extensible Crashlytics.start(this, 5); Crashlytics.setListener(createCrashlyticsListener()); Crashlytics.setPinningInfo(createPinningInfoProvider()) Crashlytics.getInstance().setDebugMode(true);
Extensible Crashlytics.setListener(createCrashlyticsListener()); Crashlytics.setPinningInfo(createPinningInfoProvider()); Crashlytics.getInstance().setDebugMode(true); Crashlytics.start(this, 5);
Extensible Crashlytics.start(this, delay, listener, pinningInfo, debugMode);
Extensible Crashlytics.start(this, 0, null, null, null, true);
Fluent Pattern Crashlytics crashlytics = new Crashlytics.Builder() .delay(1) .listener(createCrashlyticsListener()) .pinningInfo(createPinningInfoProvider())
.build(); Fabric.with(this, crashlytics);
Fluent Pattern Fabric.with(new Fabric.Builder(this) .kits(new Crashlytics()) .debuggable(true) .logger(new DefaultLogger(Log.VERBOSE)) .looper(getCustomLooper())
.executor(getCustomExecutorService()) .build());
Extensible Classes class MyApiClient extends TwitterApiClient { interface MyService {
@GET(“/1.1/statuses/show.json”) Tweet getTweet(@Query(“id”) int id); } MyService getMyService() { return getService(MyService.class); } }
Gracefully Degrade
Gracefully Degrade if (TextUtils.isEmpty(apiKey) if (debuggable){ throw new IllegalArgumentException( “apiKey
is null!"); } else { return null; } }
Minimizing Permissions
Minimizing Permissions <uses-permission android:name="android.permission.INTERNET"/>
Minimizing Permissions Crashlytics.setUserEmail(“
[email protected]
”);
Permissions: Runtime Detection protected boolean canCheckNetworkState() { String permission =
Manifest.permission.ACCESS_NETWORK_STATE; int result = context.checkCallingOrSelfPermission(permission); return (result == PackageManager.PERMISSION_GRANTED); }
Multiple Application Types
Multiple Application Types package com.example; import android.app.Service; public class MyService
extends Service { }
UI from Application Context WeakReference<Activity> currentActivity = new WeakReference<Activity>(); @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void registerLifecycleCallbacks() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) { final Application app = ((Application)context); app.registerActivityLifecycleCallbacks( new ActivityLifecycleCallbacks() { @Override public void onActivityResumed(Activity activity) { currentActivity.set(activity); } }); } }
Powerful SDKs Ease of Integration Extensibility Support all app types
Permission detection
Lightweight
Binary Size
Binary Size
3rd Party Library Mindfulness
3rd Party Library Mindfulness
How big are Fabric AARs? Fabric: 190kb Crashlytics: 90kb Beta:
13kb Answers: 20kb Twitter API & SSO: 296kb Tweet UI: 120kb Tweet Composer: 5kb Digits: 236kb
3rd Party Library Mindfulness PROTOBUF KB OURS KB
Dalvik Method Count
Dalvik Method Count >./gradlew assemble … Unable to execute dex:
method ID not in [0, 0xffff]: 65536 Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
Dalvik Method Count > git clone
[email protected]
:mihaip/dex-method-counts.git > cd dex-method-counts
> ant jar > ./dex-method-counts path/to/App.apk Read in 65490 method IDs. <root>: 65490 : 3 accessibilityservice: 6 bluetooth: 2 content: 248 pm: 22 res: 45 ... com: 53881 adjust: 283 sdk: 283
Minimize Network Usage
Network Usage 10X SMALLER 100X FASTER XML PROTOBUF
Reduce Startup Time
Startup Time Thread.start(); Executors.newSingleThreadExecutor();
Startup Time class MyThreadFactory implements ThreadFactory { @Override public Thread
newThread(Runnable runnable) { final Thread thread = new Thread(runnable); thread.setPriority(Process.THREAD_PRIORITY_BACKGROUND); return thread; } }
Lightweight SDKs Binary size 3rd party library mindfulness Dalvik Method
Count Network usage Startup time
Lightweight Powerful
Questions? dev.twitter.com @tsmith
More Decks by Ty Smith
See All by Ty Smith
Balancing Speed and Reliability: The Double-Edged Sword of Third-Party Libraries
tysmith
1
150
Mobile Developer Productivity at Uber Scale [Droidcon NYC 2022]
tysmith
6
2.5k
Building for Developers - Droidcon Italy 2019
tysmith
1
320
Tools of the Trade #DCNYC18
tysmith
5
310
ADDC 2018 - Ty Smith: Building for Developers
tysmith
2
200
Deep Android Integrations
tysmith
4
1.5k
Better Android Development with Kotlin and Gradle
tysmith
10
1.2k
Better Android Development with Kotlin and Gradle
tysmith
9
1.7k
App To Ap: Designing Local APIs On Android
tysmith
1
330
Other Decks in Programming
See All in Programming
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
390
はじめてのPLATEAU
nokonoko1203
1
660
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
320
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
450
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
250
AI Augmentation Techniques with Liberty
ivargrimstad
1
530
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
300
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
990
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k