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 Build a Weather App (2015) Networking Getting the OkHttp Library Using Gradle

I don't understand what dependencies do..

Can someone tell me simple why we are on the Github and doing with dependencies? And also OkHTTP for..?

Github is a version control system.

  • For example, if you make a mistake on your website, push to github and then to live. You can easily revert your changes. Also anytime that you push some changes to your website, github will show you original file and compare to changes that you've made. There is much more to that but this is a basic idea. One of most important aspects is that it allows multiple people to work on the same project. Simply speaking, if you make changes and push to github / live. Some other developer can pull your changes.

Dependencies - Simple example: Let's say that you have a nice navigation and it needs jQuery in order to display correctly. Hey! jQuery just became your dependency. It means that you require this in order for some piece of functionality to work properly.

Composer is a dependency management system, which pulls in all "dependencies" to your project so that you don't need to worry anymore.

In my navigation example:

  • Composer file would have a line saying that you require jQuery. It will then download jquery for you and keep latest version of it (or the version that you specify)

okHTTP - Sorry can't help on that, I'm sure someone else will answer this for you.

Have fun!

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

If you're baking a cake, you don't typically grow your own wheat to make the flour, you just buy flour at the store. It's the same way with software. We don't need to do all the work to handle the many complexities of networking; we can just add a dependency on OkHTTP and use that.

Also, here's a great workshop Craig did on Dependency Management with Gradle :)