2022.09.11 - [📱Android] - [android] 1. Retrofit이란?
[android] 1. Retrofit이란?
1. Retrofit : Android에서 REST API 통신을 지원하기 위한 라이브러리 : 서버와 클라이언트 간 Http 통신을 위한 라이브러리 Okhttp 기반으로 사용하기 쉽게 만든 것임. ( REST는 HTTP를 잘 활용하기 위한 원칙
heespace.tistory.com
2022.09.12 - [📱Android] - [android] 2. retrofit 사용 - DTO 생성
DTO는 앞선 포스트에서 만들어주었기 때문에,
permission & 나머지 Interface, Instance 정의 class가 필요하다
1. Gradle & Permission
- build.gradle(:app)에서 Retrofit2, GsonConverter 라이브러리 추가
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation 'com.google.code.gson:gson:2.8.9'
- http 통신이기 때문에 internet permission 추가
- android Pie(API28) 이상부터는 CLeartext HTTP를 비활성화하는 것으로 정책 변경되어 HTTP로 접근을 위해서 활성화 해줘야함
<manifest>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true">
...
</application>
</manifest>
1. Gradle & Permission
1. Gradle & Permission
'📱Android' 카테고리의 다른 글
[Android] MVC/MVVM/MVP 정리 (0) | 2022.10.23 |
---|---|
[android] 2. retrofit 사용 - DTO 생성 (0) | 2022.09.12 |
[android] 1. Retrofit이란? (0) | 2022.09.11 |
[Android/kakao link] 카카오링크로 메세지 보내기 + Deeplink (0) | 2022.05.01 |
[Android/Kotlin] Viewpager에서 Glide 이미지 Blur, 투명하게 (0) | 2022.04.25 |