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
- ExoPlayer
- llm
- 유튜브
- getChangePayload
- android ktor
- Zsh
- kotlin list
- 안드로이드
- build with ai
- android custom view
- 스피너
- ktor api call
- 유튜브 요약
- ktor client
- FastAPI
- video caching
- AWS EC2
- doc2vec
- android
- android exoplayer
- DiffUtil.ItemCallback
- list map
- ChatGPT
- kotlin collection
- Python
- map
- ListAdapter DiffUtil
- ListAdapter
- 시행착오
- exoplayer cache
Archives
- Today
- Total
목록retrofit (1)
버튼 수집상
[안드로이드] 가변적인 json 키를 동일한 클래스로 파싱하기
배경 같은 종류의 데이터가 각기 다른 json 키 이름으로 들어오는 api 가 있었다. 구글의 gson 라이브러리는 json 키와 데이터 클래스 변수명을 1:1로 매핑시키므로 별도의 처리가 필요했다. 예시 데이터 클래스 data class TestResponse( // 키 이름이 다른 json 값들을 읽어서 List에 add. val areaList: List? ) { data class AreaData( @SerializedName("itemType") val itemType: String?, @SerializedName("imagePath") val imagePath: String? ) } 응답값 json { "banner1" : { "itemType" : "banner1", "imagePath" :..
TIL - 안드로이드
2023. 4. 18. 15:31