issues
search
Capstone-FoodDeuk
/
Fooddeuk-Android
2021 서울과학기술대학교 컴퓨터공학과 캡스톤디자인 졸업작품
1
stars
0
forks
source link
viewModel, liveData, retrofit 설정
#34
Closed
heechokim
closed
2 years ago
heechokim
commented
2 years ago
작업 내용
서버 통신 전 예시 코드 작성했습니다~ (깃 오픈 API 서버와 통신하는 예제)
MainActivity에 3가지 임시 버튼 누르면 각자의 깃 레포지토리 이름 리스트를 git open api 서버에서 가져옵니다.
https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api
시연 영상
코드 설명
MainViewModel 클래스
MainActivity에 보여질 데이터 저장하고 있는 클래스
FooddeukServiceImpl 클래스
Retrofit 객체 생성 및 설정
FooddeukService 인터페이스
API 호출 메소드 인터페이스 작성
FooddeukAPI 클래스
FooddeukService 에 작성한 메소드 구현
GitRepoResponse
Git Open API 에서 내려주는 데이터 받을 클래스
작업 내용
시연 영상
코드 설명