Android Open Source - WiseRadar Source Fetcher Thread






From Project

Back to project page WiseRadar.

License

The source code is released under:

Apache License

If you think the Android project WiseRadar 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 wiseguys.radar.conn;
import android.util.Log;
//from  w  ww.ja  v  a  2s.c  o m
import java.io.IOException;

import org.jsoup.*;
import org.jsoup.nodes.Document;

import wiseguys.radar.helpers.RadarHelper;

public class SourceFetcherThread extends Thread {

  private String code;
  private Document htmlSource;
  private boolean getBaseImage;
  
  
  public SourceFetcherThread() {
    code = null;
        htmlSource = null;
    getBaseImage = false;
  }
  
  public void setCode(String code) {
    this.code = code;
  }
  
  public String getCode() {
    return code;
  }
  
  public Document getSource() {
    return htmlSource;
  }
  
  public void run() {
    if (code != null || getBaseImage) {

            String envURL = RadarHelper.baseURL;

            //Get a specific radar code
            envURL += "/radar/index_e.html?id=";
            envURL += (!getBaseImage && code != null) ? code : "NAT";
            getBaseImage = false;

            try {
                Connection c = Jsoup.connect(envURL);
                htmlSource = c.get();
      } catch (IOException ioe) {
                Log.e("WiseRadar","IOException Catching HTML Source");
                htmlSource = null;
      }
    }
  }
  
  public void setBaseFetch() {
    getBaseImage = true;
  }
}




Java Source Code List

wiseguys.radar.ImageFetcher.java
wiseguys.radar.RadarHelper.java
wiseguys.radar.RadarLoader.java
wiseguys.radar.conn.GPSHelper.java
wiseguys.radar.conn.ImageDownloaderThread.java
wiseguys.radar.conn.SourceFetcherThread.java
wiseguys.radar.helpers.GPSHelper.java
wiseguys.radar.helpers.RadarHelper.java
wiseguys.radar.ui.AboutFragment.java
wiseguys.radar.ui.MainActivity.java
wiseguys.radar.ui.PrefFragment.java
wiseguys.radar.ui.RadarFragment.java
wiseguys.radar.ui.adapter.Compat.java
wiseguys.radar.ui.adapter.IPhotoView.java
wiseguys.radar.ui.adapter.PhotoViewAttacher.java
wiseguys.radar.ui.adapter.PhotoView.java
wiseguys.radar.ui.adapter.SDK16.java
wiseguys.radar.ui.adapter.ScrollerProxy.java
wiseguys.radar.ui.adapter.VersionedGestureDetector.java