Android-Volley-Okttp-Gson Library

Volley is a network library from Android source code. I have integrated gson and okhttp with it.

License

License

Categories

Categories

Gson Data JSON
GroupId

GroupId

com.himanshuvirmani
ArtifactId

ArtifactId

volley-okhttp-gson-library
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Android-Volley-Okttp-Gson Library
Volley is a network library from Android source code. I have integrated gson and okhttp with it.
Project URL

Project URL

https://github.com/himanshuvirmani/android-volley-gson-okhttp
Source Code Management

Source Code Management

https://github.com/himanshuvirmani/android-volley-gson-okhttp

Download volley-okhttp-gson-library

How to add to project

<!-- https://jarcasting.com/artifacts/com.himanshuvirmani/volley-okhttp-gson-library/ -->
<dependency>
    <groupId>com.himanshuvirmani</groupId>
    <artifactId>volley-okhttp-gson-library</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.himanshuvirmani/volley-okhttp-gson-library/
implementation 'com.himanshuvirmani:volley-okhttp-gson-library:1.0.2'
// https://jarcasting.com/artifacts/com.himanshuvirmani/volley-okhttp-gson-library/
implementation ("com.himanshuvirmani:volley-okhttp-gson-library:1.0.2")
'com.himanshuvirmani:volley-okhttp-gson-library:jar:1.0.2'
<dependency org="com.himanshuvirmani" name="volley-okhttp-gson-library" rev="1.0.2">
  <artifact name="volley-okhttp-gson-library" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.himanshuvirmani', module='volley-okhttp-gson-library', version='1.0.2')
)
libraryDependencies += "com.himanshuvirmani" % "volley-okhttp-gson-library" % "1.0.2"
[com.himanshuvirmani/volley-okhttp-gson-library "1.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.3
com.squareup.okhttp : okhttp jar 2.3.0

Project Modules

There are no modules declared in this project.

Android Volley

This is an unofficial mirror for android volley library and is forked from mcxiaoke/android-volley, the source code will synchronize periodically with the official volley repository. Purpose of forking and publishing this library was to give OkHttp and Gson Serialization/Deserialization out of the box. This will reduce down any boilerplate code you would otherwise have to write to embed and use these.

Status

Volley is already published to Maven Central.

  • Maven Central

Usage

for Maven

<dependency>
    <groupId>com.himanshuvirmani</groupId>
    <artifactId>volley-okhttp-gson-library</artifactId>
    <version>1.0.2</version>
</dependency>

for Gradle

repositories {
    mavenCentral()
}
dependencies {
    compile 'com.himanshuvirmani:volley-okhttp-gson-library:1.0.2'
}

### code sample

Create a singleton request queue for network requests via volley.

``` java
RequestQueue mRequestQueue = Volley.newRequestQueue(context.getApplicationContext());

To create a request

public void getPostById(Response.Listener<Post> listener, Response.ErrorListener errorListener,
      int id) {
    mRequestQueue.add(new GetPostsById(listener, errorListener, id));
}

Create a request Class that extends GsonRequest<RequestPayload,ResponsePojo>

public class GetPostsById extends GsonRequest<Void, Post> {

  public GetPostsById(Response.Listener<Post> listener, Response.ErrorListener errorListener,
      int id) {
    super(Method.GET,
        ApiConfig.BASE_URL + ApiConfig.GET_POST_BY_ID.replace("<ID>", String.valueOf(id)), listener,
        errorListener);
  }
}

For complete code sample check Android Base Template Code

Attention

For any Gson or OkHttp issue/suggestions please write back to me at [email protected] or open an issue here. Apart from that this project is just a mirror of volley, if you have found any bugs or need some features, please create an issue at AOSP Issue Tracker.

Versions

Version
1.0.2
1.0.1
1.0.0