본문 바로가기

728x90
반응형

분류 전체보기

(149)
안드로이드 네비게이션 바, 상태바 숨기기 전체화면 모드로 아래를 스와이프 하면 네비게이션 바가 보이는 모드입니다. 이전 버전이 deperacated 되었으므로 버전을 나누어 줍니다. /** * Hides the system bars and makes the Activity "fullscreen". If this should be the default * state it should be called from [Activity.onWindowFocusChanged] if hasFocus is true. * It is also recommended to take care of cutout areas. The default behavior is that the app shows * in the cutout area in portrait mode if..
[안드로이드] module(또는 library)에서 flavors 지정하는 법 클린 아키텍처 사용으로 presentation(app)은 data, domain 모듈을 의존하고 있습니다. 그런데 data 모듈에서만 flavor를 나누고 싶었는데, presentation이 의존하고 있으므로, 같이 변화가 필요했습니다. 다음과 같이 사용하면 됩니다. data module(gradle) android{ flavorDimensions "mode" productFlavors{ cardreader{ dimension "mode" manifestPlaceholders = [ thingsRequired: "true" ] buildConfigField "Boolean","IS_CARD", "true" } nocardreader{ dimension "mode" manifestPlaceholders =..
livedata의 "androidx.lifecycle.observe is deprecated" 해결 방안 Kotlin 1.4에서 deprecated되었습니다. 다음과 같이 사용하면 됩니다. viewModel.liveData.observe(viewLifecycleOwner, Observer { result -> }) /* viewModel.liveData.observe(viewLifecycleOwner) { result -> } */ import androidx.lifecycle.observe 를 삭제, import androidx.lifecycle.Observer를 추가합니다.
1차 Low-Pass Filter(저주파 통과필터), High-Pass Filter(고주파 통과 필터) 구현하기, 코드 저주파 통과필터(Low-Pass Filter), 고주파 통과필터 (High-Pass Filter)를 이하 lpf, hpf라 부르겠습니다. 신호 처리를 함에 있어 원하는 신호를 뽑아내기 위해 lpf와 hpf를 사용하여 지지고 볶았습니다. 어느정도 원리를 깨달았죠.. 코드만 원하시면 밑으로 가면 됩니다. ㅎㅎ 책을 참고하였습니다. 1차 Low-Pass Filter lpf는 말그대로 신호의 낮은 주파수 부분을 통과시키는 건데요, 즉 신호의 높은 주파수(예를 들어 진동이나 노이즈)를 없애 신호를 좀더 매끄럽게 만들어 줍니다. 그러므로 자주 사용되죠. 이런식으로 효과를 볼 수 있습니다. Smoothing이라고도 하죠. 그냥 lpf입니다. 단순히 생각하면 lpf를 만들기 위해선 이전 측정값과 현재 측정값에 가중치를..
Window "드라이브(C:) 검사 및 복구 중: 100% 완료" 에서 멈추는 현상 1시간을 기다려도 부팅이 되지 않았습니다.. 검색해보니 6시간, 자고일어나도 안된다고하였고.. 다시 껐다 켜보라는의견이 있어서 어짜피 백업은 되어있으니(저번에 날린뒤로 ㅠㅠ)..더이상 기다릴 수 없어 고민끝에 그냥 다시 종료하고 켰더니 부팅이 되었습니다... 시간날릴뻔!
[Java/kotlin] Hex String의 Int 변환 16bit Hex String to Signed Int java int i = (short) Integer.parseInt("FFFF", 16); kotlin val i: Short = Integer.parseInt("FFFF",16).toShort() 16bit Hex String to Unsigned Int java int i = Integer.parseUnsignedInt("FFFF", 16); kotlin val i = "FFFF".toLong(16) 32bit Hex String to Signed Int java int x = (int)Long.parseLong("FFFFFFFC", 16); // x = -4 kotlin val x = "FFFFFFFC".toLong(16).toInt() // ..
[안드로이드] MediatorLiveData 가 addSource를 추가했음에도 작동하지 않는 문제 var onReadyDevice: MediatorLiveData = MediatorLiveData() fun _onReadyDevice(): Int{ return if(emg1Connected.value == true && emg2Connected.value == true) EMG_DEVICE_1_2 else if (emg1Connected.value == true) EMG_DEVICE_1 else if (emg2Connected.value == true) EMG_DEVICE_2 else -1 } init{ onReadyDevice.addSource(emg1Connected) { onReadyDevice.value = _onReadyDevice() } onReadyDevice.addSource(emg2C..
[안드로이드] RxJava Flowable 알아보기 (위키 번역) Flowable (RxJava Javadoc 2.2.21) Returns a Flowable that emits the results of a specified combiner function applied to combinations of five items emitted, in sequence, by five other Publishers. zip applies this function in strict sequence, so the first item emitted by the new Publisher wi reactivex.io Flowable class는 팩토리 메서드와 중간 오퍼레이터, reactive dataflow를 소비할 수 있는 기능을 제공하고, Reactive Stream패턴을 구현한..

728x90
반응형