@@ -0,0 +1,2377 @@
+/*%0A   Licensed under the Apache License, Version 2.0 (the %22License%22);%0A   you may not use this file except in compliance with the License.%0A   You may obtain a copy of the License at%0A%0A       http://www.apache.org/licenses/LICENSE-2.0%0A%0A   Unless required by applicable law or agreed to in writing, software%0A   distributed under the License is distributed on an %22AS IS%22 BASIS,%0A   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A   See the License for the specific language governing permissions and%0A   limitations under the License.%0A*/%0A%0Apackage edu.pdx.its.portal.routelandia;%0A%0Aimport android.os.AsyncTask;%0A%0Aimport org.json.JSONArray;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by loc on 2/6/15.%0A */%0Apublic class ParserListofHighway extends AsyncTask%3CString, Integer, List%3CHighway%3E%3E%7B%0A    protected List%3CHighway%3E highwayList = new ArrayList%3C%3E();%0A%0A%0A    /**%0A     * Override this method to perform a computation on a background thread. The%0A     * specified parameters are the parameters passed to %7B@link #execute%7D%0A     * by the caller of this task.%0A     * %3Cp/%3E%0A     * This method can call %7B@link #publishProgress%7D to publish updates%0A     * on the UI thread.%0A     *%0A     * @param params The parameters of the task.%0A     * @return A result, defined by the subclass of this task.%0A     * @see #onPreExecute()%0A     * @see #onPostExecute%0A     * @see #publishProgress%0A     */%0A    @Override%0A    protected List%3CHighway%3E doInBackground(String... params) %7B%0A        try %7B%0A            JSONArray jObject = new JSONArray(params%5B0%5D);%0A            JSONParser parser = new JSONParser();%0A%0A            // Starts parsing data%0A            highwayList.addAll(parser.parseListOfHighWay(jObject));%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return highwayList;%0A    %7D%0A%0A    /**%0A     * %3Cp%3ERuns on the UI thread after %7B@link #doInBackground%7D. The%0A     * specified result is the value returned by %7B@link #doInBackground%7D.%3C/p%3E%0A     * %3Cp/%3E%0A     * %3Cp%3EThis method won't be invoked if the task was cancelled.%3C/p%3E%0A     *%0A     * @param highways The result of the operation computed by %7B@link #doInBackground%7D.%0A     * @see #onPreExecute%0A     * @see #doInBackground%0A     * @see #onCancelled(Object)%0A     */%0A//    @Override%0A//    protected void onPostExecute(List%3CHighway%3E highways) %7B%0A//        super.onPostExecute(highways);%0A//    %7D%0A%7D%0A

add new class to creat thread in order to dowload list of highway from API