
LiveData : A lifecycle aware observable data holder class LiveData의 간단한 소개 이전 글 : dduntorry.tistory.com/entry/Android-LiveData LiveData 소개 LiveData에 대한 안드로이드 공식문서입니다. https://developer.android.com/topic/libraries/architecture/livedata.html LiveData 개요 | Android 개발자 | Android Developers LiveData를 사용하여 수명.. dduntorry.tistory.com 안드로이드에는 3가지 앱 구성요소가 있습니다. Activity, Fragment, Service 이 3가지 앱 구성요소는 L..

ViewModelFactory는 ViewModel을 통해 전달되는 인자가 있을 때 사용됩니다 class MainActivityViewModel( startingTotal: Int ) : ViewModel() { } 위와 같이 전달 인자가 있으면 사용해요 ViewModelFactory 실습 MainActivityViewModel class MainActivityViewModel( startingTotal: Int ) : ViewModel() { private var total=0 init { total = startingTotal } fun getTotal(): Int { return total } fun setTotal(input: Int) { total+=input } } MainActivityView..
단순한 결과를 얻기위해 사용되는 반복적인 코드입니다 예를 들면 gettersetter와 같은 변하지 않고 반복적으로 쓰여지는 코드를 말할 수 있겠죠 ViewModel에서 보자면 ViewModelFactory에서 모든 ViewModel에 쓰이는 보일러 코드인 "throw IllegalArgumentException" 이라 할 수 있습니다. class MainActivityViewModelFactory(private val startingTotal: Int): ViewModelProvider.Factory { override fun create(modelClass: Class): T { if(modelClass.isAssignableFrom(MainActivityViewModel::class.java)) {..

Configuration이 destroy 될 때 1. Rotation (portrait landscape) 2. keyboard changes 3. language changes 4. enabling multiwindow ..... ViewModel 생명주기 ViewModel은 ViewModel은 하나의 액티비티, 프래그먼트 혹은 여러개 액티비티, 프래그먼트에 연동됩니다. ViewModel은 액티비티나 프래그먼트의 생명주기동안 살아있다가 Finished 될 때, onCleared() 됩니다. AndroidViewModel vs ViewModel : AndroidViewModel은 memory leak가 발생할 수 있지만 Context를 사용해야 할 때 쓰며, 이 외 상황에서는 개발문서에서도 ViewMod..
DataBinding -findViewById 칠을 없애보자 build.gradle //안드로이드 스튜디오 4.1 이상에서는 아래와 같이 anroid { buildFeatures { dataBinding = true } } //안드로이드 스튜디오 4.1 미만에서는 아래와 같이 anroid { databinding { enabled = true } } activity_main.xml 위와 같이 ConstraintLayout을 layout으로 감싸고 ConstraintLayout에 있던 xmln 부분을 layout으로 이동시킵니다 data class Student( var id: Int, var name: String, var email: String ) 데이터 객체를 쓰고 싶으면 위와같이 data clas..

CAN 통신 방법 C-CAN은 고속 CAN 통신을 하고 CLU, YRS엔진, 미션, ABS, ECU(엔진), TCU 등 빠른 데이터 통신을 요구하는 ECU에서 사용됨 B-CAN은 C-CAN에 비해 저속 통신을 하고 BCM 라이트, 파워윈도우, 스마트 키 모듈과 같은 주행과 관계없는 통신에 주로 사용됨 M-CAN은 전자 기기들로서 내비게이션, 차량 내 멀티미디어 통신 기기와의 연동을 위한 각종 모듈을 포함 P-CAN에는 DATC모듈, TCU, EMS(ECU,각종 센서, 각종 액츄에이터) 등이 있으며, 샤시 관련해서 겹치는 통신이 있음 각 CAN 통신 속도는 125Kbps ~ 1Mbps 특징 Multi Master 통신을 하여 CAN BUS를 공유하고 있는 MCU들 모두가 Master 역할을 수행할 수 있으..
- Total
- Today
- Yesterday
- 제어의 역행
- CustomListView
- ViewModelFactory
- kotiln
- 자바
- setOnKeyListener
- 이클립스
- 자동로그인
- Java
- 스택제거
- DataBinding
- AOP
- Kotlin
- ADAPTER
- tomcat
- MutableLiveData
- 안드로이드
- POJO
- 스프링
- livedata
- SharedPreferences
- spring
- listview
- Enterkey
- Android
- 톰캣
- Framework
- ViewModel
- Eclipse
- 로그인
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |