Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ryan Creason
11,600 PointsWould love input - Build a Weather App w/location refresh
I've added location refresh to the refresh button in the Stormy app from the 'Build a Weather App' course. I'd love to hear input as I'm not sure if I did it in the best way possible.
Here is a link to my Stormy project on GitHub - http://bit.ly/1DbFvRh
I went through Ben's blog post about location in Android. At the bottom of the post he links to his GitHub repo with a class that separates out the Location work into a different class (LocationProvider.java). I added that class to my Stormy app. In LocationProvider.java I added a new method called refresh() which requests location updates. I then called that method in the onclick listener attached to the refresh button.
It seems to work, but I'm afraid that it may be inefficient or there might be a better way. I'd love to hear people's thoughts on this so I can think about it a different way if needed. Thanks in advance for your help!
Ryan Creason
11,600 PointsYeah, it just updates from the timezone provided from the JSON data. Thanks for taking a look!
Carl Sergile
16,570 PointsHey Ryan, took a look at your code. Looks good/clean and simple. Im also working on the stormy weather app myself and got stumped on Ben's blog post as I think it may just be outdated because I got some errors and was unable to move on. I want to first understand exactly whats going on line for line, and then I am going to build up my own weather app. Is it okay to copy this code right into my new app project? If a yes, will this work as of Oct. 10, 2016? or should I worry about outdated code? Thanks
Bruce Parmele
6,474 PointsBruce Parmele
6,474 PointsRyan,
Looks promising and I only took a cursory view of your code.. Are you able to dynamically update the location name as well?