Android Open Source - ThinkPageSDK_Android T P City






From Project

Back to project page ThinkPageSDK_Android.

License

The source code is released under:

MIT License

If you think the Android project ThinkPageSDK_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.thinkpage.sdk;
import android.location.Location;
//from   w  w w.  j  a v a 2s .  co  m
public class TPCity 
{
  //ivars
  private String _name;
  private String _cityid;
  private Location _location;
  
  //functions
  public TPCity(String name)
  {
    _name = name;
    _cityid = null;
    _location = null;
  }
  
  public TPCity(String name, String cityid)
  {
    _name = name;
    _cityid = cityid;
    _location = null;    
  }
  
  public TPCity(Location location)
  {
    _name = null;
    _cityid = null;
    _location = location;    
  }
  
  public String getName()
  {
    return _name;
  }
  
  public String getCityID()
  {
    return _cityid;
  }
  
  public Location getLocation()
  {
    return _location;
  }
  
  public boolean equals(TPCity city)
  {
    if (_name.equals(city.getName()))
    {
      return true;
    }
    
    if (_cityid.equals(city.getCityID()))
    {
      return true;
    }
    
    if (_location.distanceTo(city.getLocation()) < 500/*meters*/)
    {
      return true;
    }
    return false;
  }
  
  public String description()
  {
    if (_name != null)
    {
      return _name;
    }
    else if (_cityid != null)
    {
      return _cityid;
    }
    return null;
  }
}




Java Source Code List

com.example.thinkpageandroid.MainActivity.java
com.loopj.android.http.AsyncHttpClient.java
com.loopj.android.http.AsyncHttpRequest.java
com.loopj.android.http.AsyncHttpResponseHandler.java
com.loopj.android.http.Base64DataException.java
com.loopj.android.http.Base64OutputStream.java
com.loopj.android.http.Base64.java
com.loopj.android.http.BaseJsonHttpResponseHandler.java
com.loopj.android.http.BinaryHttpResponseHandler.java
com.loopj.android.http.DataAsyncHttpResponseHandler.java
com.loopj.android.http.FileAsyncHttpResponseHandler.java
com.loopj.android.http.JsonHttpResponseHandler.java
com.loopj.android.http.JsonStreamerEntity.java
com.loopj.android.http.MySSLSocketFactory.java
com.loopj.android.http.PersistentCookieStore.java
com.loopj.android.http.PreemtiveAuthorizationHttpRequestInterceptor.java
com.loopj.android.http.RangeFileAsyncHttpResponseHandler.java
com.loopj.android.http.RequestHandle.java
com.loopj.android.http.RequestParams.java
com.loopj.android.http.ResponseHandlerInterface.java
com.loopj.android.http.RetryHandler.java
com.loopj.android.http.SerializableCookie.java
com.loopj.android.http.SimpleMultipartEntity.java
com.loopj.android.http.SyncHttpClient.java
com.loopj.android.http.TextHttpResponseHandler.java
com.thinkpage.sdk.TPAirQuality.java
com.thinkpage.sdk.TPCity.java
com.thinkpage.sdk.TPWeatherFuture.java
com.thinkpage.sdk.TPWeatherManagerDelegate.java
com.thinkpage.sdk.TPWeatherManager.java
com.thinkpage.sdk.TPWeatherNow.java
com.thinkpage.sdk.TPWeatherSuggestions.java
com.thinkpage.sdk.TPWeather.java