Android Open Source - NYU-BusTracker-Android Time Downloader Helper






From Project

Back to project page NYU-BusTracker-Android.

License

The source code is released under:

Apache License

If you think the Android project NYU-BusTracker-Android 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 com.nyubustracker.helpers;
//from w ww.  j av  a  2 s . c o  m
import android.util.Log;

import com.nyubustracker.activities.MainActivity;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class TimeDownloaderHelper implements DownloaderHelper {
    @Override
    public void parse(JSONObject jsonObject) throws JSONException, IOException {
        if (jsonObject != null && jsonObject.toString().length() > 0) {
            BusManager.parseTime(jsonObject);
            if (MainActivity.LOCAL_LOGV) {
                Log.v(MainActivity.LOG_TAG, "Creating time cache file: " + jsonObject.getString("stop_id"));
                Log.v(MainActivity.LOG_TAG, "*   result: " + jsonObject.toString());
            }
            Downloader.cache(jsonObject.getString("stop_id"), jsonObject);
        }
        else {
            throw new JSONException(jsonObject == null
                    ? "TimeDownloaderHelper#parse given null jsonObject"
                    : "TimeDownloaderHelper#parse given empty jsonObject");
        }
    }
}




Java Source Code List

com.nyubustracker.NYUBusTrackerApplication.java
com.nyubustracker.activities.MainActivity.java
com.nyubustracker.adapters.StopAdapter.java
com.nyubustracker.adapters.TimeAdapter.java
com.nyubustracker.helpers.BusDownloaderHelper.java
com.nyubustracker.helpers.BusManager.java
com.nyubustracker.helpers.DownloaderHelper.java
com.nyubustracker.helpers.Downloader.java
com.nyubustracker.helpers.MultipleOrientationSlidingDrawer.java
com.nyubustracker.helpers.RouteDownloaderHelper.java
com.nyubustracker.helpers.SegmentDownloaderHelper.java
com.nyubustracker.helpers.StopDownloaderHelper.java
com.nyubustracker.helpers.TimeDownloaderHelper.java
com.nyubustracker.helpers.VersionDownloaderHelper.java
com.nyubustracker.models.Bus.java
com.nyubustracker.models.Route.java
com.nyubustracker.models.Stop.java
com.nyubustracker.models.Time.java