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

Android

Luke Farrell
Luke Farrell
3,278 Points

Why don't you put the OkHTTP code into a new class? or is this considered bad practise?

Hi Ben,

Just wondering why the code in the MainActivity to check network availability and get JSON data isn't put into its own separate class? Is this not the principle of single responsibility or am I not fully understanding MVP design patterns in android?

THIS IS FOR BUILD A WEATHER APP (STORM). For some reason it won't let me attach it to the video.

Thanks