Back to project page ReadabilitySDK.
The source code is released under:
MIT License
If you think the Android project ReadabilitySDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.idemidov.readability.parser; /*w w w .j a va 2s . c o m*/ import com.idemidov.readability.data.CommandResponse; import com.idemidov.readability.util.ResultCode; import org.json.JSONException; import java.util.HashMap; /** * Created by Ilya on 25/02/14. */ public class AuthParser implements Parser<HashMap<String, String>> { @Override public CommandResponse<HashMap<String, String>> parse(String response) throws JSONException { return parseQueryString(response); } private CommandResponse<HashMap<String, String>> parseQueryString(String queryString) { CommandResponse<HashMap<String, String>> response = new CommandResponse<HashMap<String, String>>(); HashMap<String, String> result = new HashMap<String, String>(); String[] entity = queryString.split("&"); for (int i = 0; i < entity.length; ++i) { String[] pair = entity[i].split("=", 2); result.put(pair[0], pair[1]); } response.setCode(ResultCode.CODE_OK); response.setData(result); return response; } }