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 | 31 |
Tags
- ListAdapter
- 안드로이드
- kotlin list
- Zsh
- doc2vec
- ktor api call
- android ktor
- ktor client
- Python
- DiffUtil.ItemCallback
- 유튜브 요약
- AWS EC2
- 유튜브
- kotlin collection
- llm
- 스피너
- map
- ListAdapter DiffUtil
- ChatGPT
- ExoPlayer
- getChangePayload
- 시행착오
- android
- android custom view
- build with ai
- video caching
- exoplayer cache
- list map
- FastAPI
- android exoplayer
Archives
- Today
- Total
목록gson (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