Android Open Source - MobileCrossPlatformTools Weather






From Project

Back to project page MobileCrossPlatformTools.

License

The source code is released under:

GNU General Public License

If you think the Android project MobileCrossPlatformTools 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 es.tid.weather.common;
//from  w  ww. j  av  a 2 s.  c  o m
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.io.StreamCorruptedException;
import java.util.List;

public class Weather implements Serializable{
  private static final long serialVersionUID = 1L;
  public String city;
  public CurrentWeather currentWeather;
  public List<WeatherDay> forecast;

  public Weather(String city, CurrentWeather currentWeather,
      List<WeatherDay> forecast) {
    this.city = city;
    this.currentWeather = currentWeather;
    this.forecast = forecast;
  }

  public static void Serialize(Weather weather, String filePath) throws FileNotFoundException, IOException {
    ObjectOutput out = new ObjectOutputStream(new FileOutputStream(filePath));
      out.writeObject(weather);
      out.close();
  }

  public static Weather Deserialize(String filePath) throws StreamCorruptedException, FileNotFoundException, IOException, ClassNotFoundException {
     File file = new File(filePath);
     ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
     Weather weather = (Weather) in.readObject();
     in.close();
     return weather;
  }  
}




Java Source Code List

es.tid.weather.common.CurrentWeather.java
es.tid.weather.common.Definitions.java
es.tid.weather.common.WeatherApplication.java
es.tid.weather.common.WeatherDay.java
es.tid.weather.common.Weather.java
es.tid.weather.http.ConnectionManager.java
es.tid.weather.http.HttpConnection.java
es.tid.weather.http.HttpResult.java
es.tid.weather.main.GpsListener.java
es.tid.weather.main.WeatherActivity.java
es.tid.weather.opengl.CubeRenderer.java
es.tid.weather.opengl.Cube.java
es.tid.weather.opengl.TranslucentGLSurfaceViewActivity.java
es.tid.weather.splash.SplashActivity.java