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

"Skipped 60 frames! The application may be doing too much work on its main thread"--BlogReader

This error just showed up while doing a run I did at the end of the Getting Data from a JSON Request video. I can't make heads or tails out of the info I see when googling the question.

I do see there is a "known issue", but don't know if that could generate this error.

Any insight into this error message and how to address would be greatly appreciated.

1 Answer

In Android you have UI Threads, which are threads that are executed when a UI event happens (a button clicked). These UI events need to happen quickly and if you have a lot of code in your UI events then you will see this error message. Also this will occur with asynchronous events like fetching data from a URL. The solution is to use threads or async tasks. You want to off load any heavy code off of your UI Threads and onto another area - a new thread or in your main activity. This information helped me greatly. Take a look at the section "Worker Threads and AsyncTask":

http://developer.android.com/guide/components/processes-and-threads.html

This definitely helped clear the fog. I am wondering if I did something wrong while doing the lesson, or if the code as per the video does generate this problem.