This project is read-only.

Animaonline Weather API - Tutorials - JSharp

Tutorial
  • Start Visual Studio
  • Go to "File" --> "New" --> "Project" --> "Console Application"
  • Click OK
Now you will have to add the Animaonline Weather API Library to your project's reference list
  • Go to "Project" --> "Add Reference..." --> Open the "Browse" tab, and browse for the compiled Animaonline Weather API Library --> "OK"
Now you are set to start writing some code.

Add the following code to the application's static void main
		Animaonline.WeatherAPI.WeatherAPI awAPI = new Animaonline.WeatherAPI.WeatherAPI();
		awAPI.FillWeatherData("Tokyo", true);
		System.Console.WriteLine("Current temperature in {0}, {1}°F/{2}°C", awAPI.get_postal_code(), System.Convert.ToString(awAPI.get_temp_f()),System.Convert.ToString(awAPI.get_temp_c()));


The application will look like this when you're done
package Animaonline_Weather_API_Test;

public class Program
{
	public static void main(String[] args)
	{
		Animaonline.WeatherAPI.WeatherAPI awAPI = new Animaonline.WeatherAPI.WeatherAPI();
		awAPI.FillWeatherData("Tokyo", true);
		System.Console.WriteLine("Current temperature in {0}, {1}°F/{2}°C", awAPI.get_postal_code(), System.Convert.ToString(awAPI.get_temp_f()),System.Convert.ToString(awAPI.get_temp_c()));
	}
}


  • Now start your application by pressing Ctrl + F5

If you encounter any errors , feel free to ask in the forums.

P.S. For a full list of properties refer to API Overview page.

Programmed by Roman Alifanov, uses Google's Weather Feed, licensed under GNU General Public License version 2
© 2007-2009 Roman Alifanov

Last edited Jul 31, 2009 at 2:28 PM by animaonline, version 4

Comments

No comments yet.