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
Android: Introduction Android Support Annotations
Search
Sato Shun
August 11, 2015
Programming
150
0
Share
Android: Introduction Android Support Annotations
Sato Shun
August 11, 2015
More Decks by Sato Shun
See All by Sato Shun
Kotlin Nativeにおけるfrozen状態と並行処理について
satoshun
0
1k
DroidKaigi 2020: System UIをコントロールして、 画面を最大限に生かしたアプリを構築する / Build apps that make the best uses of device screens by controlling System UI
satoshun
4
2k
タップルでたっぷりDaggerを使って マルチモジュール構築している話 :)
satoshun
2
2.6k
Kotlin Fest 2019: Kotlin型実践入門
satoshun
9
7k
R8/ProGuard 徹底比較
satoshun
8
4.3k
Android: Daggear2でDI
satoshun
0
180
Other Decks in Programming
See All in Programming
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
200
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
9
2.6k
Inside Stream API
skrb
1
220
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
380
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
620
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
2
540
AIとRubyの静的型付け
ukin0k0
0
130
AI時代になぜ書くのか
mutsumix
0
460
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
250
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
570
Modding RubyKaigi for Myself
yui_knk
0
470
JavaDoc 再入門
nagise
0
130
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Documentation Writing (for coders)
carmenintech
77
5.3k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
660
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
360
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
140
It's Worth the Effort
3n
188
29k
How STYLIGHT went responsive
nonsquared
100
6.1k
Transcript
Android Support Annotationsの紹介 potatotips#20 2015/8/11 佐藤 隼
Jake先生のRxBindingリポジトリを見てみると...
Android Support Annotations? Android開発において, 役に立つannotationが 定義されているライブラリ
IntDef/StringDef 複数の定数から, 論理的な型を宣言 enumの代わりに使う. 列挙パターンにenumを使うのはバッドプ ラクティス
IntRange/FloatRange 定義域を宣言
Size 配列のサイズを宣言(min, maxも可)
RequiresPermission 呼び出すのに必要なpermissionを宣言
CallSuper サブクラスがメソッドを呼び出さなければならないこ とを宣言
UiThread/WorkerThread UI(Worker)スレッドか ら呼び出さなければな らないことを宣言
- LayoutRes, StringRes, ColorRes, … - 特定のresourceのみを受け入れることを宣言 - Keep -
proguardを無視することを宣言 - CheckResult - 返り値を使わなければいけない - VisibleForTesting - testのためにaccess可視性を広げていることを宣言 - Nullable, NonNull - Nullを許さない(許す)ことを宣言.
- 適切にannotationをつけることで, ドキュメント の一部になると共に, バグの軽減が期待できる - Kotlinの波がキテる? まとめ
参考 - https://developer.android. com/intl/ja/tools/debugging/annota tions.html - http://tools.android.com/tech- docs/support-annotations