모바일/Android_Java(100)
-
LiveData VS Databinding Observable
LiveData 일반적인 Observable과는 다르게 LiveData는 안드로이드 생명주기(LifeCycle)를 알고 있습니다 액티비티나, 프레그먼트, 서비스 등과 같은 안드로이드 컴포넌트의 생명주기(Lifecycle)를 인식하며 그에따라 LiveData는 활성상태(active)일때만 데이터를 업데이트(Update) 합니다. 1. 장점 메모리 누수(Memory Leak)가 없습니다. Observer 객체는 안드로이드 생명주기 객체와 결합되어 있기 때문에 컴포넌트가 Destroy 될 경우 메모리상에서 스스로 해제합니다. Stop 상태의 액티비티와 Crash가 발생하지 않습니다. 액티비티가 Back Stack에 있는 것처럼 Observer의 생명주기가 inactive(비활성화) 일 경우, Observer는..
2020.10.10 -
[Android]Timber 사용하기
What is Timber? Timber는 Android의 Log 클래스 위의 구축된 로깅 유틸리티 클래스입니다. 개발 과정에서는 Log를 남길 수 있고, 릴리즈 시점에서는 Log를 출력 하고 싶지 않을때 주로 사용합니다. Log를 사용할 때. private fun showLog(){ val message = "this is message" Log.d("tagging","log is required for the string format $message") } Timber 사용할 때 private fun showTimber(){ val message = "Timber" Timber.d("This is $message") } timber로 표현하는게 훨씬 간결해보이지 않나요? 그렇다면 Tibmer을 사용하..
2020.10.10 -
NDK와 OpenCV
최근 차량 번호판 인식 프로젝트를 진행하고있는데 두 라이브러리를 새롭게 사용해야할것같다. 공부해서 작성하자!
2020.09.30 -
retrofit path vs query
1 Consider this is the url: www.app.net/api/searchtypes/862189/filters?Type=6&SearchText=School Now this is the call: @GET("/api/searchtypes/{Id}/filters") Call getFilterList( @Path("Id") long customerId, @Query("Type") String responseType, @Query("SearchText") String searchText ); So we have: www.app.net/api/searchtypes/{Path}/filters?Type={Query}&SearchText={Query} Things that come after the ?..
2020.09.26 -
EditText 관련 에러와 수정사항
edittext는 말썽이많다.. clickable = true cursorVisible = false enabled = true imeOptions = actionDone 등등.. 값들 셋팅을안해주니 빈값으로 다음에딧텍스트로 넘어갔다가 다시 돌아올때 requestFocus를 안먹었다 이번엔 포커스 잘 먹는데 값이 안보이네..
2020.09.13 -
enum 함수
enum 비교 Static Methods valueOf(String arg) String 값을 enum에서 가져온다. 값이 없으면 Exception 발생 valueOf(Class class, String arg) 넘겨받은 class에서 String을 찾아, enum에서 가져온다. valueOf(String arg)는 내부적으로 자기 자신의 class를 가져오는 것이다. values() enum의 요소들을 순서대로 enum 타입의 배열로 리턴한다. ENUM$VALUES의 카피이므로, 너무 자주 호출하는 것은 좋지 않음. Static 아닌 Methods name() 호출된 값의 이름을 String으로 리턴한다. ordinal() 해당 값이 enum에 정의된 순서를 리턴한다 compareTo(E o) 이 en..
2020.07.01