Android開発–通信用ライブラリVolleyを利用するサンプルコード
1.Gradle
dependencies {
compile 'com.github.bumptech.glide:volley-integration:1.0.+’
compile 'com.mcxiaoke.volley:library:1.0.+’
}
dependencies {
compile 'com.github.bumptech.glide:volley-integration:1.0.+’
compile 'com.mcxiaoke.volley:library:1.0.+’
}
2.Maven
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>volley-integration</artifactId>
<version>1.0.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.mcxiaoke.volley</groupId>
<artifactId>library</artifactId>
<version>1.0.5</version>
<type>aar</type>
</dependency>
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>volley-integration</artifactId>
<version>1.0.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.mcxiaoke.volley</groupId>
<artifactId>library</artifactId>
<version>1.0.5</version>
<type>aar</type>
</dependency>
3.ActivityにVolleyを使う
public void onCreate() {
Glide.get(this).register(GlideUrl.class, InputStream.class,
new VolleyUrlLoader.Factory(yourRequestQueue));
…
}
public void onCreate() {
Glide.get(this).register(GlideUrl.class, InputStream.class,
new VolleyUrlLoader.Factory(yourRequestQueue));
…
}