Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |
Tags
- 코틀린 이미지저장 #파일저장
- apk이름변경
- compse state
- 데이터바인딩
- 라이브데이터 postValue
- TowmonUSB 연결오류
- 코틀린 트리거 버튼
- 안드로이드 스튜디오 애뮬레이터
- Room 데이터베이스 업데이트
- 토글 험수
- livedata
- mutable
- TwomonUSB
- withContext
- json 저장
- compse collectAsState
Archives
- Today
- Total
목록코틀린 이미지저장 #파일저장 (1)
EnjoyLife
이미지를 내부 저장소에 저장하는 함수
fun downloadImage(url: String, folderName: String, fileName: String?) { val appContext = applicationContext() //본인코드에 맞게 가져온다. // 폴더 생성 val folder = File(appContext.filesDir, folderName) if (!folder.exists() && !folder.mkdirs()) { Log.e("FileRepository", "Failed to create directory: $folderName") return } // 파일 경로 설정 val outputFile = File(folder, fileName) ..
안드로이드 개발/개발팁
2024. 5. 1. 15:48