• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Developing a weather forecast application

holdborn

Lurker
May 13, 2010
1
0
Hi all,

I'm developing a weather forecast application and I'm in need of some help here.

At first, the application uses radio buttons to either get the location of the user through GPS or enter a location manually. Once the user decides what they will do, I used the code below to progress:

Code:
	public void onClick(View v) {
		if (v == getReport)
		{
			if(getLocation.isChecked() == true)
			{
				handleReverseGeocodeClick();
			}
			if(specifyLocation.isChecked() == true)
			{
				locationString = ((EditText) findViewById(R.id.locationInput)).getText().toString();
				parseWeather(locationString);
			}
		}


handleReverseGeocodeClick(); calls up Google's reverse geocoding and translates the coordinates to a location, and the other code converts the location to a string and calls the parseWeather() method to operate on a parser to parse the report from the goolge api.

I then implemented the parser and created another class, WeatherReport which basically stores information about the weather.

As the parser goes through the report, I used the following code to store the details in WeatherReport:

Code:
				int temp = Integer.parseInt(dataAttribute);
				this.weatherReport.setTomorrowsMaxTemp(temp);

I've created the layout of the weather report in another view, called report and I want to load this layout once the parsing is complete. I don't really know how to do that so any help would be appreciated.

Thank you
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones