Aasiya3 / ElephantBook_FieldGuide

Apache License 2.0
1 stars 1 forks source link

Add authentication to the API #42

Closed bsakai2000 closed 2 years ago

bsakai2000 commented 2 years ago

Adds HTTP Basic Authorization to the ApiGetter class so we can use it with the new API. Both the JSON request and the image requests support this authentication.

Big refactor in ApiGetter.downloadImage is caused by the move from an ImageLoader to an ImageRequest. The logic is mostly the same but it allows us to override getHeaders to insert the basic auth credentials, while the ImageLoader request is not exposed. Tested and working on my device

Resolves #31 Resolves #32