image
www.flickr.com
William C. Arter's photos More of William C. Arter's photos

« This week's reading | Main | Readings for 2/9 »

January 30, 2009

New Location Example using home values @ 3:45 PM

Hey,

Here's a new file showing how to use a home values web service to build a little price thermometer. Basically, in the new sketch, we set a switch that makes the app react to either the temperature service, or a home values service, and then decides what to do with the returned values.


//set up the service type, either temperature or homevalues
String serviceType;
serviceType = "homevalues";

//use this new url to get either temp or home values
request = client.GET("/clients/405/services.php?service="+serviceType+"&lat=34.052187&lon=-118.243425");

in the libraryEvent method, we'll check to see which type of service we are using. If it's the homevalues service, we'll turn on the draw() animation loop using loop(); Otherwise, we'll just call redraw() to call the draw() function only once.


if(serviceType == "temperature") {
redraw(); //call the draw() function once
} else if(serviceType == "homevalues") {
//start animating again
loop();
}

Download file

com.mpp.player.PowerPlayerAppScreenSnapz001.jpg

| all rights william carter |
| view cc license |

Thanks for signing in, . Now you can comment. (sign out)


Remember me?