freezy/android-xbmcremote-sandbox — pull request #21 by SyncedSynapse (2014-04-30 22:00:23+00:00)
Title: Fixed image loading when XBMC has Basic Authentication set.

This fixes [Issue #20](https://github.com/freezy/android-xbmcremote-sandbox/issues/20).

Problem is Glide doesn't have an option to fetch images with Basic Authentication enabled, and while theoretically just specifying the url with ```http://user:password@host:port``` should work, i still kept receiving 401s.

To solve this, the following changes were made:
* The URLs for fetching images are of the form ```http://user:password@host:port```
* All class to Glide are made using a custom ModelLoader and StreamLoader (VolleyBasicAuthModelLoader and VolleyBasicAuthStreamLoader), which set the HTTP authorization header based on what's present on the URL to load. These classes are essentially the same that are present in Glide (VolleyUrlModelLoader and VolleyUrlStreamLoader), with the added GetHeaders override. I couldn't subclass the existing ones because some necessary members of those classes are private.

Please review this, and check if you find it acceptable.

Some other notes:
* I stashed the ModelLoader and StreamLoader classes under org.xbmc.android.util. If you would like for them to be in other place, let me know.
* I changed the getUri/getActiveIri members in XBMCHost and HostManager to accept a boolean specifying whether to return the "simple" URL or the URL with the user credentials. This seemed like the simplest thing to do, but if you don't like it i can do it some other way.