코틀린 3

[Kotlin] Retrofit2 + OkHttp로 API request 시작기

- Retrofit square.github.io/retrofit/ Retrofit A type-safe HTTP client for Android and Java square.github.io 안드로이드에서 사용가능한 REST Client (서버 통신을 위한 라이브러리) Retrofit은 HTTP요청에 OkHttp 라이브러리를 사용함 처음에 Asynctask를 알려주셨었는데 Asynctask는 어렵고 시간도 많이 들고 해서 안드로이드에서 deprecated 되었다고 한다 1. build.gradle(Module:) > dependencies에 Retrofit, OkHttp 추가 // Retrofit: 서버와 통신 implementation 'com.squareup.retrofit2:retrofit:2...

Web | App/Android 2020.12.06

[Kotlin] data class 여러 개 코드 컨벤션

먼가 개발을 하는데 한 파일에 클래스를 여러개 만드니까 얘만 아이콘이 이렇게 파일 형태로 바뀌고,, 확장자도 보이고,, 그래서 코틀린 코드 컨벤션을 찾아봤다 kotlinlang.org/docs/reference/coding-conventions.html#source-file-organization Coding Conventions - Kotlin Programming Language kotlinlang.org Placing multiple declarations (classes, top-level functions or properties) in the same Kotlin source file is encouraged as long as these declarations are closely relat..

Web | App/Android 2020.12.05