Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Setting Up the Imgur API

justin z
justin z
11,042 Points

treehouseworkshop's server DNS address could not be found.

After signing in to imgur, I get redirected to a page that says "This site can't be reached. treehouseworkshop's server DNS address could not be found. DNS_PROBE_FINISHED_NXDOMAIN" My code is exactly the same as it is in the video (including the missing code in onResume() ), so I'm not sure why this isn't working. Also the URL of the redirected webpage is https://treehouseworkshop:88. Any ideas?

Raphael Okure
Raphael Okure
2,600 Points

For posterity, the missing code snippets can be found here.

@justinz: Questions for you:

  • When you ran the app, were you taken to the Imgur website and asked to authorize the app's access?
  • If so, and if you successfully authorized, were you prompted to "Complete action using" (a choice between your browser and your retrofit app)?
  • If yes, this is where you should choose to complete the action with your app. If not: ** Cross-check the <intent-filter> in your your AndroidManifest.xml file. (Your app uses this filter to tell Android, "Whenever a user tries to open (specified url), don't bother the browser; I'll handle it.") ** Make sure that the URL in your manifest matches the redirect url you entered into your imgur account application. The url used in the video isn't a real one (definitely not now), and the Imgur API docs say that you can even use 'localhost' for your redirect URL.

Summary: For this lesson; if you're getting sent to a browser instead of your app, you may be using a redirect URL that doesn't match either what's in your manifest file, or in your Imgur application settings. As a result, the Android system is using the default URL Viewer (browser) to handle that URL.

Cheers!

justin z
justin z
11,042 Points

Raphael Okure, My problem was that after I was successfully authorized, I was prompted to "Complete action using" and chose to use the web browser instead of the app, so that's fixed. However now that it redirects back to the app, I get the "Failed :(" snackbar when I try to fetch the images. Since there are no errors in the log, there isn't really a way for me to debug the issue. Do you know of anything I could try?