Android Open Source - Projectile String Listener






From Project

Back to project page Projectile.

License

The source code is released under:

Apache License

If you think the Android project Projectile listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.nicktate.projectile;
//w  w w  . j  a  v a  2 s  .com
import com.android.volley.NetworkResponse;
import com.android.volley.toolbox.HttpHeaderParser;

import java.io.UnsupportedEncodingException;

/**
 * Convenience listener that returns a string
 */
public abstract class StringListener implements ResponseListener<String> {
    @Override
    public String responseParser(NetworkResponse networkResponse) {
        String response;
        try {
            response = new String(networkResponse.data, HttpHeaderParser.parseCharset(networkResponse.headers));
        } catch (UnsupportedEncodingException e) {
            response = new String(networkResponse.data);
        }
        return response;
    }
}




Java Source Code List

com.nicktate.Sample.java
org.nicktate.projectile.JsonElementListener.java
org.nicktate.projectile.Method.java
org.nicktate.projectile.NetworkResponseListener.java
org.nicktate.projectile.OkHttpStack.java
org.nicktate.projectile.Priority.java
org.nicktate.projectile.ProjectileRequest.java
org.nicktate.projectile.Projectile.java
org.nicktate.projectile.ResponseListener.java
org.nicktate.projectile.StringListener.java