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
Best Practices Mobile SDKs_DroidConGreece16
Search
Emma Tresanszki
July 08, 2016
Technology
1
150
Best Practices Mobile SDKs_DroidConGreece16
Best practices in building mobile SDKs - DroidCon Greece 2016
Emma Tresanszki
July 08, 2016
Tweet
Share
More Decks by Emma Tresanszki
See All by Emma Tresanszki
Improve your code with Lint checks for Kotlin
emmatresanszki
0
49
AndroidSummit2017_Best practices in building mobile libraries
emmatresanszki
0
44
Other Decks in Technology
See All in Technology
SmartNewsにおける 1000+ノード規模 K8s基盤 でのコスト最適化 – Spot・Gravitonの大規模導入への挑戦
vsanna2
0
100
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
6k
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
6
2.1k
AIとともに進化するエンジニアリング / Engineering-Evolving-with-AI_final.pdf
lycorptech_jp
PRO
0
150
Zephyr RTOSを使った開発コンペに参加した件
iotengineer22
1
180
CI/CD/IaC 久々に0から環境を作ったらこうなりました
kaz29
1
220
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
2
550
AWS Organizations 新機能!マルチパーティ承認の紹介
yhana
1
240
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
26k
rubygem開発で鍛える設計力
joker1007
3
360
PO初心者が考えた ”POらしさ”
nb_rady
0
160
Tech-Verse 2025 Keynote
lycorptech_jp
PRO
0
1.5k
Featured
See All Featured
Visualization
eitanlees
146
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
The Invisible Side of Design
smashingmag
301
51k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Code Reviewing Like a Champion
maltzj
524
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
500
YesSQL, Process and Tooling at Scale
rocio
173
14k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Transcript
Best Practices in Building Mobile SDKs Emma Tresanszki Android Developer
[email protected]
GitHub: @emmaChristine
About me
Agenda - SDK or Library? - Managing Dependencies - Creating
Libraries - Publishing Libraries
SDK or Library?
SDK or library ? A library -> chunk of code
An SDK -> is still a library (often with extra tool applications, data files and sample code)
Why do we need one? Make an existing service or
API easily usable Offer a mobile specific service
Examples
Examples 2FA phone number verification
Why not ?
None
None
None
Managing dependencies
Which dependency ? Developers can’t be trusted to update their
dependencies? compile 'com.android.support:appcompat-v7:23.0.+' But what has changed? In Gradle, dynamic versions use the + sign:
Dynamic dependencies are evil Dynamic versions add nondeterminism to your
build. - Behaviour changes - “But it works on my machine” - Difficult to revert Fix it
Versioning - Version numbers are used to encode compatibility for
the API. - Local store the current version/configurable file - Semantic versioning {major}.{minor}.{bugfix}. - Use stable version instead of beta.
Using <SNAPSHOT> in development - Prevent caching while developing -
or lower cache setting
None
What is .aar ? - /AndroidManifest.xml (mandatory) - /classes.jar (mandatory)
- /res/ (mandatory) - /R.txt (mandatory) - /assets/ (optional) - /libs/*.jar (optional) - /proguard.txt (optional) - /lint.jar (optional) - I/O 2013
Validation - Fail fast when rejecting invalid params. Actually not
all the time! - Do not discard future capabilities. - Should be flexible:let the API handle rejections instead.
Should your SDK include UI ? - Fabric Digits’ button
& Themes
Library size - Library size: 3rd party dependencies or not
at all - e.g. libphonenumber in a 2fa phone verification lib ( ~500KB)
Packaging: Permissions - Runtime permissions - Marker selectors - Don’t
let libraries silently add permissions to your app project/module/build/intermediates/manifests/full/[flavor]/build-type/AndroidManifest.xml.
Keep a changeLOG - Is there a standard changeLOG format?
- Why should I care? - Why can’t people just use a git log diff? - Minimize the effort by using an “UNRELEASED” section - How bad can it be? - No deprecation - Dates in region-specific formats
Keep a changeLOG What makes a good changeLOG? - Readable
- Dates YYYY-MM- DD - Group changes ADDED CHANGED DEPRECATED REMOVED FIXED SECURITY
DOCUMENTATION - Copy-paste a working demo. - How much time
you should hook the dev? - Good API reference - Advanced usage - Changelogs <version number>
Publish .aar
Publish to central repo - requirements - GAV coordinates -
Sign files with GPG/PGP
Publish to central repo - requirements - Project, description and
URL - License, Developer and SCM information
~/.gradle/gradle.properties
~/.gradle/gradle.build
~/.gradle/gradle.properties
$gradle uploadArchives
Stage & release
Done!
Thanks! Emma Tresanszki Android Developer
[email protected]
GitHub: @emmaChristine
References - Automated Gradle project deployment to Sonatype OSS repository
- Maven Repository Usage Guide - http://www.leveluplunch.com/java/examples/parse-phone-number-from-string/ - http://www.theappguruz.com/blog/integrate-paypal-in-android//dropbox - http://blog.danlew.net/2015/09/09/dont-use-dynamic-versions-for-your-dependencies/ - https://github.com/olivierlacan/keep-a-changelog - http://skife.org/src/design/libraries/2011/12/14/library_versioning.html