SlideShare a Scribd company logo
Android Kotlin
2017.06.29
Kenichi Kambara (@korodroid)
6 Kotlin
About me
•
•
• Droidcon Stockholm 2014
• Droidcon Spain 2014
• Droidcon Amsterdam 2013
• Droidcon Paris 2013
• Smartphone & Tablet 2014 Spring Tokyo
• Developers Summit 2013 Summer & 2015
•
• Mobile Dev Blog
• Android
• NTT
(@korodroid)
Introduction
• Kotlin
•
Kotlin
Qiita ( )
Kotlin
- : All Java
- OSS: DataBinding / Retrofit
Kotlin
- : All Kotlin
- OSS:
Kotlin
Kotlin
[Menu]Code->Convert Java File to Kotlin File
(^^)v
…
(><)
…
AndroidアプリのKotlin移行時に遭遇した問題と対処例
Error:Circular dependency
between the following tasks:
:app:compileDebugKotlin
Error:Circular dependency
between the following tasks:
:app:compileDebugKotlin
Gradle Plugin
Gradle Plugin
(3.0.0-alpha3 )
Caused by: java.lang.IllegalArgumentException:
Parameter specified as non-null is null: method
kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull,
parameter savedInstanceState
Caused by: java.lang.IllegalArgumentException:
Parameter specified as non-null is null: method
kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull,
parameter savedInstanceState
Kotlin Nullable
NotNull
Nullable ( ? )
※ ( )
Unresolved reference: databinding
Unresolved reference: ActivityMainBinding
…
Unresolved reference: databinding
Unresolved reference: ActivityMainBinding
…
Kotlin Java
GenerateStubs
App build.gradle
android {

…
kapt {
generateStubs = true
}
…
}
Cannot access 'binding': it is
private in 'ViewBindingHolder'
Cannot access 'binding': it is
private in 'ViewBindingHolder'
binding
private
private
Platform declaration clash: The following
declarations have the same JVM signature
(getRetrofit()Lretrofit2/Retrofit;):
Platform declaration clash: The following
declarations have the same JVM signature
(getRetrofit()Lretrofit2/Retrofit;):
Kotlin getter/setter
getter/setter
e.g.) getRetrofit→getRetrofitInstance
Smart cast to 'Retrofit' is impossible,
because 'retrofit' is a mutable property
that could have been changed by this time
Smart cast to 'Retrofit' is impossible,
because 'retrofit' is a mutable property
that could have been changed by this time
SmartCast
)Smart Cast
Smart Cast
fun demo(x: Any) {
if (x is String) {
print(x.length)
}
Smart Cast
fun demo(x: Any) {
if (x is String) {
print(x.length) //
}
Smart Cast
fun demo(x: Any) {
if (x is String) {
print(x.length) // Kolin
}
Conclusion (Kotlin )
•
• Kotlin
• ( ) 

or Kotlin
Appendix
- Please let me know if you have any requests 

such as technical speeches, technical writings and so on.
Facebook:http://fb.com/kanbara.kenichi
Google+:+Kenichi Kambara
LinkedIn:http://www.linkedin.com/in/korodroid
Twitter:@korodroid
Thank you so much.

More Related Content

PDF
Pythonによる黒魔術入門
PPTX
20171005 告白に学ぶ http status code
PPTX
ちゃんとした C# プログラムを書けるようになる実践的な方法~ Visual Studio を使った 高品質・低コスト・保守性の高い開発
PDF
ASP.NETの進化とASP.NET Core Blazorの凄さ
PPT
メタプログラミングって何だろう
PDF
gRPC入門
PDF
Pythonの理解を試みる 〜バイトコードインタプリタを作成する〜
PDF
SAT/SMTソルバの仕組み
Pythonによる黒魔術入門
20171005 告白に学ぶ http status code
ちゃんとした C# プログラムを書けるようになる実践的な方法~ Visual Studio を使った 高品質・低コスト・保守性の高い開発
ASP.NETの進化とASP.NET Core Blazorの凄さ
メタプログラミングって何だろう
gRPC入門
Pythonの理解を試みる 〜バイトコードインタプリタを作成する〜
SAT/SMTソルバの仕組み

What's hot (20)

PDF
DSIRNLP#1 ランキング学習ことはじめ
PDF
組み込みでこそC++を使う10の理由
PDF
Prometheus at Preferred Networks
PDF
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
PDF
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
PPTX
AVX-512(フォーマット)詳解
PPTX
Clojureの世界と実際のWeb開発
PPTX
世界一わかりやすいClean Architecture
PDF
Bluetoothl-Low-Energy入門講座-part1
PDF
関数プログラマから見たPythonと機械学習
PDF
自宅サーバラックの勧め BGP4編
PDF
シリコンバレーの「何が」凄いのか
PDF
目grep入門 +解説
PPTX
BoostAsioで可読性を求めるのは間違っているだろうか
PPTX
Pycairo を使ってみる その1
PDF
Java仮想マシンの実装技術
PDF
Node-v0.12の新機能について
PDF
ruby-ffiについてざっくり解説
PDF
君はyarn.lockをコミットしているか?
PPTX
goroutineはどうやって動いているのか
DSIRNLP#1 ランキング学習ことはじめ
組み込みでこそC++を使う10の理由
Prometheus at Preferred Networks
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
AVX-512(フォーマット)詳解
Clojureの世界と実際のWeb開発
世界一わかりやすいClean Architecture
Bluetoothl-Low-Energy入門講座-part1
関数プログラマから見たPythonと機械学習
自宅サーバラックの勧め BGP4編
シリコンバレーの「何が」凄いのか
目grep入門 +解説
BoostAsioで可読性を求めるのは間違っているだろうか
Pycairo を使ってみる その1
Java仮想マシンの実装技術
Node-v0.12の新機能について
ruby-ffiについてざっくり解説
君はyarn.lockをコミットしているか?
goroutineはどうやって動いているのか
Ad

More from Kenichi Kambara (20)

PDF
Hello Flutterの次におさえたい Flutterのポイント その6 (レイアウト編)
PDF
Hello Flutter”の次におさえたい Flutterのポイント その5
PDF
[ABC2018Spring]Flutterアプリ開発入門
PDF
“Hello Flutter”の次におさえたい Flutterのポイント その4
PDF
[Google I/O 2018 Highlights] Sandbox
PDF
[Google I/O 2018 Highlights] Flutter / WearOS
PDF
"Hello Flutter"の次におさえたいFlutterのポイントその3
PDF
Hello Flutterの次におさえたいFlutterのポイントその2
PDF
I/Oへの期待+海外渡航持ち物Tips
PDF
Hello Flutterの次におさえたいFlutterのポイント
PDF
Developing Android Apps for Google Assistant
PDF
Google Assistant対応アプリ開発3つのポイント
PDF
10分で作るGoogle Assistant対応アプリ
PDF
[Kotlin勉強会] Hello Kotlinの次におさえたいKotlinの勘所
PDF
Android O (Picture In Picture)入門+実装例
PDF
Android O (Beta) Topics
PDF
Publishing Android Wear 2.0 Apps
PDF
Android Studio 2.3 New Features
PDF
Android 7.0 Nougat マルチウィンドウ解説+α
PDF
日本androidの会定例会2016年6月_Android Wear 2.0+関連展示紹介
Hello Flutterの次におさえたい Flutterのポイント その6 (レイアウト編)
Hello Flutter”の次におさえたい Flutterのポイント その5
[ABC2018Spring]Flutterアプリ開発入門
“Hello Flutter”の次におさえたい Flutterのポイント その4
[Google I/O 2018 Highlights] Sandbox
[Google I/O 2018 Highlights] Flutter / WearOS
"Hello Flutter"の次におさえたいFlutterのポイントその3
Hello Flutterの次におさえたいFlutterのポイントその2
I/Oへの期待+海外渡航持ち物Tips
Hello Flutterの次におさえたいFlutterのポイント
Developing Android Apps for Google Assistant
Google Assistant対応アプリ開発3つのポイント
10分で作るGoogle Assistant対応アプリ
[Kotlin勉強会] Hello Kotlinの次におさえたいKotlinの勘所
Android O (Picture In Picture)入門+実装例
Android O (Beta) Topics
Publishing Android Wear 2.0 Apps
Android Studio 2.3 New Features
Android 7.0 Nougat マルチウィンドウ解説+α
日本androidの会定例会2016年6月_Android Wear 2.0+関連展示紹介
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Programs and apps: productivity, graphics, security and other tools
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

AndroidアプリのKotlin移行時に遭遇した問題と対処例