Back to project page NYU-BusTracker-Android.
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.
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"); } } }