Sottti/OkHttp-Volley-Gson
Über uns
Historical Java Android networking sample showing Volley requests backed by OkHttp and parsed with Gson.
Systeme und InfrastrukturGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalAndroid 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.
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
RequestQueuebacked byOkHttp3Stack. - Generic
GsonGetRequest<T>andGsonPostRequest<T>implementations. - Gson parsing for a JSON object and a JSON array.
- A custom Gson deserializer for the sample
DummyObjectmodel. - Request tagging and cancellation from
onStop(). - Volley
ImageRequestfor a single remote bitmap. - Volley
NetworkImageViewwith a sharedImageLoader. - An
LruBitmapCachesized 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.
Ähnliche Projekte entdecken
Wird geladen…