Learn hints, tips and tricks from the Twitter Fabric development team, and the principles that guided their creation of this modular and powerful SDK.
Presentation delivered at DroidconNL, Amsterdam, Nov 2014
Thanks to Andrea Falcone and the Fabric team for content and materials. You can see a lightning version of this talk delivered at Twitter Flight here -> https://www.youtube.com/watch?v=3h7jQU1AOvw&index=2&list=PLFKjcMIU2WsjUiy7UcPiWNxktpin0WDgu
23. Gracefully Degrade
if (TextUtils.isEmpty(apiKey)
if (debuggable){
throw new IllegalArgumentException(
“apiKey is null!");
} else {
return null;
}
}
40. 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
46. 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;
}
}
47. Lightweight SDKs
Binary size
3rd party library mindfulness
Dalvik Method Count
Network usage
Startup time