kodecocodes / adva-materials

The projects and materials that accompany the Real-World Android by Tutorials book
Other
228 stars 94 forks source link

Network connection does not work anymore #35

Closed Scythal closed 2 years ago

Scythal commented 2 years ago

It seems the network API does not connect anymore. It's hard to say exactly where since the application has been made unnecessarily complicated.

blueglyph commented 2 years ago

Hello? Anyone still working on this project?

The problem is due to an "HTTP 401 Unauthorized" response from the server.

blueglyph commented 2 years ago

I see that instead of "token_type": "Bearer" (documentation), we have TOKEN_TYPE = "Bearer " in ApiConstants.kt. It's even visible in the book. So I don't know if the extra space is a problem, but simply removing it doesn't solve the 401.

Trying to get the complete response in that spaghetti of a code is taking too much time. You should really re-do this with an easier and less convoluted example.

rcosteira79 commented 2 years ago

Hi there! First of all, so sorry for the ridiculously late reply. I thought I had notifications on this, but apparently I didn't 🤦

I just went through the chapters, building the project from start to finish on each one, and never ran across this issue 🤔 from the looks of it, it seems that you're not using a valid API key / API secret. Did you get yours from https://www.petfinder.com/developers/?

blueglyph commented 2 years ago

Hi, thanks but it doesn't matter anymore, this can be closed.