Skip to content
프로젝트

Sottti/OkHttp-Volley-Gson

GitHub에서 보기

소개

Historical Java Android networking sample showing Volley requests backed by OkHttp and parsed with Gson.

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Android Networking I: OkHttp, Volley and Gson

Article companion — inactive. This repository contains the sample code for Android Networking I: OkHttp, Volley and Gson on Medium. It is preserved for reference and is not under active development.

Java OkHttp Volley Gson Status

A Java Android sample showing how to combine Volley, OkHttp, and Gson in one small networking playground.

The app uses Volley as the request queue and UI-facing request API, swaps in a custom OkHttp-backed HttpStack as the transport layer, and parses JSON responses with reusable Gson request classes.

✨ What It Demonstrates

  • A Volley RequestQueue backed by OkHttp3Stack.
  • Generic GsonGetRequest<T> and GsonPostRequest<T> implementations.
  • Gson parsing for a JSON object and a JSON array.
  • A custom Gson deserializer for the sample DummyObject model.
  • Request tagging and cancellation from onStop().
  • Volley ImageRequest for a single remote bitmap.
  • Volley NetworkImageView with a shared ImageLoader.
  • An LruBitmapCache sized from the device display.
  • Data Binding for simple click handlers and screen bindings.

🖼️ Demo Screens

Screen What It Shows
JsonObjectActivity GET a single object and bind title/body text.
JsonArrayActivity GET an array and render multiple parsed objects.
NetworkImageViewActivity Load a list of remote images through Volley image loading.
ImageRequestActivity Load one bitmap through ImageRequest with an error fallback.

⚙️ Tech Stack

  • Java
  • Android Gradle Plugin 3.0.1
  • Gradle 4.5.1
  • compile SDK 27, target SDK 27, min SDK 16
  • Android Support Library 27.0.2
  • Volley 1.0.0
  • OkHttp 3.9.1
  • Gson 2.8.2
  • Data Binding
  • RecyclerView and ConstraintLayout

🚀 Run It

This repo is pinned to 2018 Android tooling. For the least friction, use an Android Studio/JDK setup compatible with AGP 3.0.1 and Gradle 4.5.1.

./gradlew :app:assembleLiveDebug
./gradlew :app:installLiveDebug

The sample uses old public demo endpoints and image URLs. If any network call no longer responds, the app still remains useful as a reference for the request, transport, parsing, caching, and cancellation patterns.

🧪 Verification

No automated test suite is included in this historical sample. The practical sanity check is to build the debug app:

./gradlew :app:assembleLiveDebug

📌 Status

This is a historical sample for an old Android networking article series, not a modern networking template. Its value today is as a compact reference for how Volley, OkHttp, and Gson can be wired together in a pre-AndroidX Java app.

📜 License

The original README declared this repository to be MIT licensed. A standalone LICENSE file is not currently present in the repository.

관련 프로젝트 살펴보기

불러오는 중…