package com.chariotinstruments.markets;

import android.os.AsyncTask;

import java.util.ArrayList;

/**
 * Created by user on 1/25/16.
 */
public class ParseData extends AsyncTask<Void, Void, Void> {

    private String _target;
    private ArrayList<String> _data;

    //Constructor
    public ParseData(){
        
    }

}

@@ -75,247 +75,2716 @@
 ort 
-java.util.ArrayList;%0A%0A/**%0A * Created by user on 1/25/16.%0A */%0Apublic class ParseData extends AsyncTask%3CVoid, Void, Void%3E %7B%0A%0A    private String _target;%0A    private ArrayList%3CString%3E _data;%0A%0A    //Constructor%0A    public ParseData()%7B%0A        
+com.github.scribejava.core.builder.ServiceBuilder;%0Aimport com.github.scribejava.core.model.OAuthRequest;%0Aimport com.github.scribejava.core.model.Response;%0Aimport com.github.scribejava.core.model.Token;%0Aimport com.github.scribejava.core.model.Verb;%0Aimport com.github.scribejava.core.oauth.OAuth10aService;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0A%0Aimport java.util.ArrayList;%0A%0A/**%0A * Created by user on 1/25/16.%0A */%0Apublic class ParseData extends AsyncTask%3CVoid, Void, Void%3E %7B%0A%0A    private String _target;%0A    private ArrayList%3CString%3E _data;%0A    private String opnConcat;%0A    APIKeys apiKeys = new APIKeys();%0A    private TradeKingApiCalls tk;%0A%0A    private static final String GET_QUOTES = %22quotes%22;%0A    private static final String GET_RESPONSE = %22response%22;%0A    private static final String GET_QUOTE = %22quote%22;%0A%0A    protected void onPreExecute()%7B%0A        super.onPreExecute();%0A        System.out.println(%22pre exec.......%22);%0A    %7D%0A%0A    protected Void doInBackground(Void... arg0)%7B%0A%0A        //Build the OAuth service%0A        final OAuth10aService service = new ServiceBuilder()%0A                .apiKey(apiKeys.CONSUMER_KEY)%0A                .apiSecret(apiKeys.CONSUMER_SECRET)%0A                .build(TradeKingApi.instance());%0A        Token accessToken = new Token(apiKeys.OAUTH_TOKEN, apiKeys.OAUTH_TOKEN_SECRET);%0A%0A        // Fetch the JSON data%0A        OAuthRequest request = new OAuthRequest(Verb.GET, tk.getMarketYesterdaysMinuteData(%22SPY%22), service);%0A        service.signRequest(accessToken, request);%0A        Response response = request.send();%0A        try %7B%0A            parseJSON(response);%0A        %7D catch (JSONException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        //Parse the JSON%0A%0A%0A        return null;%0A    %7D%0A%0A    protected void onPostExecute(Void result)%7B%0A        super.onPostExecute(result);%0A        System.out.println(%22post exec......%22);%0A    %7D%0A%0A    private void parseJSON(Response response) throws JSONException %7B%0A        JSONObject json = new JSONObject();%0A        JSONObject jsonResponse = new JSONObject();%0A        JSONObject jsonQuotes = new JSONObject();%0A        JSONArray jsonQuote = new JSONArray();%0A        String output = %22%22;%0A%0A        //dataTextView.setText(response.getBody());%0A%0A        json = new JSONObject(response.getBody());%0A        jsonResponse = json.getJSONObject(GET_RESPONSE);%0A        jsonQuotes = jsonResponse.getJSONObject(GET_QUOTES);%0A        jsonQuote = jsonQuotes.getJSONArray(GET_QUOTE);%0A%0A        for (int i = 0; i %3C jsonQuote.length(); i++)%7B%0A            JSONObject curQuote = jsonQuote.getJSONObject(i);%0A%0A            output = output +%22, %22+ curQuote.getString(%22opn%22);%0A        %7D%0A%0A        System.out.println(output);
 %0A   

work on async