Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building the Fabric SDKs - #MBLTDev (30 min)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ty Smith
October 28, 2014
Programming
220
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
More Decks by Ty Smith
See All by Ty Smith
Balancing Speed and Reliability: The Double-Edged Sword of Third-Party Libraries
tysmith
1
130
Mobile Developer Productivity at Uber Scale [Droidcon NYC 2022]
tysmith
6
2.4k
Building for Developers - Droidcon Italy 2019
tysmith
1
310
Tools of the Trade #DCNYC18
tysmith
5
300
ADDC 2018 - Ty Smith: Building for Developers
tysmith
2
180
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
310
Other Decks in Programming
See All in Programming
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
300
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
630
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
180
Built Our Own Background Agent at LayerX
layerx
PRO
9
5k
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.7k
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
110
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.7k
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
760
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
460
Utilizing Notion as your number one productivity tool
mfonobong
4
520
Un-Boring Meetings
codingconduct
0
380
Ethics towards AI in product and experience design
skipperchong
2
340
Darren the Foodie - Storyboard
khoart
PRO
3
3.6k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
480
Done Done
chrislema
186
16k
Agile that works and the tools we love
rasmusluckow
331
22k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
620
Chasing Engaging Ingredients in Design
codingconduct
0
260
Building AI with AI
inesmontani
PRO
1
1.1k
Transcript
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