JSONPlaceholder에서 제공하는 fake API 활용 Android sample.
Android AAC-ViewModel과 Adapter ViewModel을 사용하였다. MainActivity와 DetailActivity 2개로 구분되어 있으며, 각각의 ViewModel에서 데이터를 불러와 갱신하는 작업을 한다. JSONPlaceholder에서 제공하는 fake API 활용 Android sample.
다음 샘플은 아래와 같은 API을 활용한다.
- get posts : @GET https://jsonplaceholder.typicode.com/posts
- option : _start={page}, _limit={per_page}
- get post : @GET https://jsonplaceholder.typicode.com/posts/{postId}
- get comments : @GET https://jsonplaceholder.typicode.com/posts/{postId}/comments/
- delete post : @DELETE https://jsonplaceholder.typicode.com/posts/{postId}
아래의 Android API을 활용.
- android support appcompat-v7
- android support recyclerview-v7
- android support constraint-layout
- android lifecycle extensions
- airbnb lottie
- squareup retrofit2
- squareup retrofit2:adapter-rxjava2
- squareup retrofit2:converter-gson
- squareup okhttp3
- squareup okhttp3:logging-interceptor
- reactivex.rxjava2:rxandroid
- reactivex.rxjava2:rxjava
- junit:junit
Copyright 2018 Tae-hwan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.