전체 글

    D/error: Only the original thread that created a view hierarchy can touch its views.

    0. 오류 내용 D/error: Only the original thread that created a view hierarchy can touch its views. 1. 오류 원인 해당 오류는 메인스레드에서 UI 변경을 해주지 않아서 나는 오류라고 생각한다.예를 들면 Thread에서 UI 갱신을 해주기 위해서 이런 저런 코드를 사용하는 것과 같다. 2. 변경 전 코드 12345678910111213movieRetrofit.getSearch( clientId = getResourceString(R.string.naver_client_id), clientPw = getResourceString(R.string.naver_client_secret), type = "movie.json", query = se..

    Retrofit을 통한 Naver 영화 API 사용하기

    0. 서론 아무 의미 없이 코드를 작성할 땐, 단순하게 통신이 됐으면 그저 내 것이라고 생각을 했다.RxJava를 공부하면서 느낀 것이지만 기존에 알고 있던 코드를 분석해보고, 이야기를 해 볼 필요가 있다는 것을 알게 됐다. 1. Retrofit 1-1. Retrofit 각종 클라이언트 통신 라이브러리가 있다면, 해당 라이브러리를 맵핑해서 REST 방식의 호출을 사용할 수있게 하는 유용한 라이브러리이다. 1-2. OkHttp OkHttp 라이브러리는 HTTP 호출시에 각종 값들을 셋팅할 수 있게 도와주는 라이브러리이다.Retrofit과 같이 사용되는 이유는 OkHttp를 통해서 쿠키, timeout, log등 각종 HTTP와 관련된 통신을 도와주기 때문이다.Retrofit은 이처럼 클라이언트를 통해서 얻..

    [JAVA 다른 KOTLIN ] function 기초, 프로퍼티의 getter setter

    0. 이전글 2018/12/13 - [Java와 다른 Kotlin] - [JAVA 다른 KOTLIN ] if-else, switch, when 1. a+b 기본 1-1. JAVA CODE: 12345678910111213public class StudyClassJava extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_empty); aPlusB(15,10); } private int aPlusB(int a, int b) { return a + b; }}C..

    [JAVA 다른 KOTLIN ] if-else, switch, when

    0. 서론코틀린에 대한 공부가 필요해서 자바와는 다른 코틀린이라는 주제로 공부내용을 정리할 예정입니다. 1. if-else1-1. JAVA CODE: 12345678910111213141516171819202122232425import android.os.Bundle;import android.support.annotation.Nullable;import android.support.v7.app.AppCompatActivity;import android.util.Log; public class StudyClassJava extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { sup..

    Android 2way databiding - bindingAdapter(2)

    -1. 이전글2018/12/11 - [Android 공부] - 안드로이드 2way DataBinding 0. kotlin에서 databinding 사용하기코틀린에서 데이터바인딩 사용하는 것은 예제만 따라하기에도 많은 시간이 사용된다. gralde버전에 따라서 각종 변수가 달라지기도 하고, dataBinding에서 setVariable과 같은 매소드의 사용방법을알려주는 사람이 없다거나, BindingAdapter와 같이 코드 또한 xml로 처리하고 싶을 때,그리고 수많은 오류가 있기에 kotlin에서 databinding 사용하는 것은 나와 같이 초보 개발자들에게는어려운 점이라고 생각한다. .1. 지난 글 지난 글에서는 단순하게 @={변수명}을 통해서 xml을 통해서도 값을 넣을 수 있다는 것을 알 수 있..

    java.lang.IllegalStateException: Required DataBindingComponent is null in class ItemMovieBindingImpl. A BindingAdapter in hbs.com.boostcampmoviesearch.MovieVM is not static and requires an object to use, retrieved from the DataBindingComponent. If you d..

    1. Error Content : java.lang.IllegalStateException: Required DataBindingComponent is null in class ItemMovieBindingImpl. A BindingAdapter in hbs.com.boostcampmoviesearch.MovieVM is not static and requires an object to use, retrieved from the DataBindingComponent. If you don't use an inflation method taking a DataBindingComponent, use DataBindingUtil.setDefaultComponent or make all BindingAdapter..

    안드로이드 2way DataBinding

    0. 이전 글: 2018/12/04 - [Android 공부] - 안드로이드 DataBinding?? MVVM?? 1. 문제점: 1-1. 코드: 1-2. 문제 : EditText의 text를 뽑아내고 싶었지만, 그럴 수 없었고 차선책으로 Button에서 click시에userVM.updateTextView()라는 매소드에 EditText를 변수로 해서 이동시켜서 getText() 했었습니다. 2-1. 개선사항: 2way databinding을 이용하게 되면 우리가 관리하고 있는 변수에 xml의 값을 넣을 수 있다는 것을 알 수 있었습니다. 2-2. 출처: https://developer.android.com/topic/libraries/data-binding/two-way 2-3. 개선된 코드: 12345..

    RxJava 공부 3 - Map과 FlatMap, Timer와 interval, FlatMap과 ConcatMap

    -1. 이전글 2018/12/10 - [rxJava 공부] - RxJava 공부 1 - just, create, fromArray, interval, range, fromIterable, filter, map2018/12/10 - [rxJava 공부] - RxJava 공부 2 - AsyncSubject, BehaviorSubject, PublishSubject, ReplaySubject0. 출처 http://reactivex.io/documentation/ko/operators.html 1. Map & FlatMap Map — Observable이 배출한 항목에 함수를 적용한다FlatMap — 하나의 Observable이 발행하는 항목들을 여러개의 Observable로 변환하고, 항목들의 배출을 차례차례..