[Kotlin] startactivity, putextra
코틀린에서는 더이상 자바처럼 findViewById 할 필요가 없다. 코드에 `view`의 `id`를 적으면 자동완성에 어느 layout의 view를 import 할 것인지 표시된다. 코드에서 메인 레이아웃에 있는 ‘nextBtn’라는 id의 버튼 View를 호출하면, 상단에 다음과 같이 import 된다.
[Kotlin] android DataBinding Library for kotlin
DataBinding Library 는 유연성과 폭넓은 호환성을 제공하여 선언적 레이아웃을 작성 가능하게끔 지원해줌으로써, 어플리케이션 로직과 레이아웃을 바인딩 하는데 유용하게 사용 할 수 있습니다.
Viewmodel Example
A little over two years ago, I was working on Android for Beginners; a class that takes students from zero programming to their first Android app. As part of the course, students build a very simple one screen app called Court-Counter.
ViewModels: Persistence, onSaveInstanceState(), Restoring UI State and Loaders
In the last blog post I explored a simple use case with the new ViewModel class for saving basketball score data during a configuration change. ViewModels are designed to hold and manage UI-related data in a life-cycle conscious way. ViewModels allow data to survive configuration changes such as screen rotations.
ViewModels and LiveData: Patterns + AntiPatterns
Ideally, ViewModels shouldn’t know anything about Android. This improves testability, leak safety and modularity. A general rule of thumb is to make sure there are no android.* imports in your ViewModels (with exceptions like android.arch.*). The same applies to presenters.