본문 바로가기

728x90
반응형

분류 전체보기

(149)
[안드로이드] scrcpy를 사용하여 화면 미러링 하기 https://github.com/Genymobile/scrcpy 위의 github주소에서 Windows: download를 통해 zip파일 다운 후, sdk저장 경로인 Android\sdk\platform-tools 에 덮어쓰기해줍니다. 그 후 터미널에서, scrcpy 입력하면 실행됩니다. 부하가 너무 크면 에러가 날 수 있으므로, scrcpy --bit-rate 2M --max-size 800 bit rate와 size를 조정하여 실행하였습니다.
[Nordic nRF52] 타이머 추가하기 nRF5 SDK Application Timer Tutorial 2018-11-23: Updated tutorial to cover SDK version 15.2. 2019-02-08: Improved example project (SDK 15.2) and updated instructions accordingly. Introduction Scope The following topics will be included in this tutorial: Configuration of the application... devzone.nordicsemi.com 위의 링크를 참조하여 싱글샷 or repeated 타이머를 만들 수 있습니다. Include및 sdk 설정 #include "app_timer.h" #in..
[안드로이드] Bitmap 사이즈 줄이기 /** * reduces the size of the image * @param image * @param maxSize * @return */ private fun getResizedBitmap(image: Bitmap, maxSize: Int): Bitmap? { var width = image.width var height = image.height val bitmapRatio = width.toFloat() / height.toFloat() if (bitmapRatio > 1) { width = maxSize height = (width / bitmapRatio).toInt() } else { height = maxSize width = (height * bitmapRatio).toInt() } ..
[안드로이드] 커스텀 스피너 만들기 위와 같은 그림의 커스텀 스피너를 만들어 보겠습니다. 화살표 모양을 아이콘으로 하는 layer-list를 만들어 drawble 폴더에 추가해줍니다. spinner_custom.xml color, icon, margin dp등을 적절히 조절해 줍니다. icon은 벡터 이미지면 적용이 안됩니다. 배경을 black으로 하면 오른쪽 공백을 조금 준것을 확인할 수 있습니다. spinner layout 추가 배경을 LinearLayout으로 감싸고 색깔을 주었습니다. Spinner 레이아웃에서 드랍다운 팝업의 스타일을 설정할 수 있습니다. android:overlapAnchor="false" android:popupElevation="10dp" android:popupBackground="#DEDEDE" andro..
[안드로이드] 엑셀 파일 기록 & 만들기 라이브러리 추가 https://poi.apache.org/download.html#POI-4.1.0 위의 사이트로 가서 poi-bin 압축파일 최신버전을 다운로드 받습니다. 다운로드 후 압축을 풀어, poi-5.1.0.jar 파일을 추가하면 됩니다. 간단히 추가하기 위해서 poi-5.1.0.jar 파일을 앱 프로젝트 폴더 내로 옮겼습니다. libs 폴더를 하나 만들어 옮겨줍니다. 그 후 안드로이드 스튜디오내에서, 오른쪽 클릭 하여 Add As Library하여 추가합니다. 그럼 gradle 파일에 추가된 것을 확인할 수 있습니다. saf로 파일 생성 하기 엑셀 파일을 생성, 저장하기 위해 saf를 사용합니다. @SuppressLint("SimpleDateFormat") fun exportExcelData..
[Android] Room + RxJava 정리 Dependecy // Room components def roomVersion = '2.3.0' implementation "androidx.room:room-runtime:$roomVersion" kapt "androidx.room:room-compiler:$roomVersion" implementation "androidx.room:room-ktx:$roomVersion" implementation "androidx.room:room-rxjava2:$roomVersion" androidTestImplementation "androidx.room:room-testing:$roomVersion" // RxJava implementation "io.reactivex.rxjava2:rxjava:2.2.17..
[안드로이드] 화면 꺼짐 방지 코드 Kotlin window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) Java getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); onCreate() 에 추가
nordic nus service에 READ characteristic 추가 battery level 만 read하고 싶어 read할 수 있는 새 Characteristic을 추가 하였음 blle_nus.h /**@brief Nordic UART Service structure. * * @details This structure contains status information related to the service. */ struct ble_nus_s { uint8_t uuid_type; uint16_t service_handle; ble_gatts_char_handles_t tx_handles; ble_gatts_char_handles_t rx_handles; ble_gatts_char_handles_t bat_handles; //added blcm_link_ctx_stor..

728x90
반응형