I'm trying to grab JSON data from google by using asynctask. But i get a lot of errors I don't know why. I'm new to android development, I was interested in it then quit now back again :P.
and on the button click which executes the asynctask
new usdjson().execute();
this is my Asynctask
private class usdjson extends AsyncTask<URL, Void, JSONObject> {
@Override
protected Boolean doInBackground(URL... urls) {
// I get this from Boolean : The return type is incompatible with AsyncTask<URL,Void,JSONObject>.doInBackground(URL[])
URL url = new URL(requestUrl);
loadJSON(url);
}
@Override
protected void onPostExecute(JSONObject jsonData) {
try {
String USD = json.getJSONArray("rhs");
//I get this from json. :json cannot be resolved
}
}
public void loadJSON(URL url) {
JSONParser jParser = new JSONParser();
//I get this from JSONPareser JSONParser cannot be resolved to a type
JSONObject json = jParser.getJSONFromUrl(url);
return json;
//Void methods cannot return a value
}
sorry for being long