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
James Brittain
1,675 PointsWhy is this so HARD!?!
So I've been doing everything I can think of to try to get past this code challenge for the last month. I'm sure its something stupidly simple but I can't figure it out. (C:\Users\James\Pictures\Screenshots\CodeChallenge.png)
20 Answers
Paulo Aguiar
14,120 PointsYou didnt tell it bestFrog is a string?
Mirza Curevac
Courses Plus Student 14,294 PointsTry String bestFrog = frogNames[0];
Matthew Jewell
Courses Plus Student 3,619 PointsHey James, I've seen a few things you've posted where it turns out your error was mis-typing something. Don't worry about it man, this isn't a typing lesson. Use tools to help you.
I always mis-type everything and forget semi-colons etc- so I keep an IDE (I use IntelliJ) open, write my answers there and then paste them into the answers field.
Ben Jakuben
Treehouse TeacherYes, this is a great helper! We are looking into adding compiler errors into the engine as well to help with this kind of stuff in the future.
James Brittain
1,675 Points...thanks guys. Uhm, I basically figured out most of what I was doing wrong. Instead of code I'm starting to think of it like a language that has to be read line by line. Like you can't tell it to do something with an object until you've defined that object for it.
James Brittain
1,675 PointsC:\Users\James\Pictures\Screenshots\CodeChallenge.png
James Brittain
1,675 Points[screenshot](C:\Users\James\Pictures\Screenshots\CodeChallenge.png)
James Brittain
1,675 PointsJames Brittain
1,675 PointsPaulo Aguiar
14,120 Pointsyeah they dont like to give out the complete answer here buddy
Mirza Curevac
Courses Plus Student 14,294 PointsOh realy? I didn't know anything about that :s
James Barnett
39,199 PointsYep we try to give help not answers. If someone can't pass a code challenge it's probably because they aren't understanding something, explanations and hints help with that more than cutting & pasting an answer.
James Brittain
1,675 Pointsweird, I tried that once before and it didn't work, CRAP I misspelled string UGH, all that head over a stupid typo. I was using like Str to define something as a string. Thanks.
Mirza Curevac
Courses Plus Student 14,294 PointsDon`t despair man :) you will find your self often in things like that forgetting a quotation mark, bracket, dot or stuff like that :)
James Brittain
1,675 PointsIts just frustrating, this is one thing on a very short list of things that is difficult for me to learn (curves and spleens, vascular anatomy, and cinestetics). I tend to be very much a creative big picture person and this is such an incredibly logical detail oriented, can't make a single mistake kind of thing.
James Brittain
1,675 PointsBen Jakuben
Treehouse TeacherYou're close! getDrawable() is a method, which means it has to end with parenthesis, even though nothing goes in them. That's how we differentiate methods from properties.
James Brittain
1,675 Pointshttp://postimg.org/image/t8yrxsgj7/
I'm missing something here
Matthew Jewell
Courses Plus Student 3,619 PointsHey James, I've seen a few things you've posted where it turns out your error was mis-typing something. Don't worry about it man, this isn't a typing lesson. Use tools to help you.
I always mis-type everything and forget semi-colons etc- so I keep an IDE (I use IntelliJ) open, write my answers there and then paste them into the answers field.
Paulo Aguiar
14,120 PointsWhile I do agree in a real-world situation youll always have IDE's, i dont agree with using them to move on in treehouse. Instead, use the treehouse editor and keep some documentation handy. You think you're doing something wrong? look it up. Thats what programmers do in the real world. Thats the reason people cant post answers here, people look it up and cheat.
Matthew Jewell
Courses Plus Student 3,619 PointsProgrammers use IDEs in the real world too... An IDE isn't going to teach you how to program any more than a spell checker can teach you how to write. But it helps find the annoying errors like a missing semi colon
Paulo Aguiar
14,120 PointsPlease re-read what i wrote. I said we DO use them. I suggested its better to learn without them at first. Its better to make these mistakes now than to spend hours wondering why your IDE didnt warn you a bout an error.
Matthew Jewell
Courses Plus Student 3,619 PointsOk, I guess we disagree that it's better to learn without them. Yes, you need documentation, whether you're typing with or without help. Maybe a full blown IDE is overkill for a few code challenges, but something along the lines of JSHint would help me greatly. I'm trying to learn the concepts and structures of Android programming so I can go and build my own apps, and don't need to get bogged down with spending time trying to find syntax errors
Paulo Aguiar
14,120 PointsYeah we can agree to disagree. Everyone learns in their own ways, i just find I learn a lot better if I don't rely on the IDE. Sure, i can code a few things quicker, get underlines on my accidental missing semicolons, but If i can make them so natural that I don't even think about them anymore, thats when you've truly learned it. Its the same thing for new objects or code in general. If you understand the general concept of how it works and how to set it up, then thats where the IDE comes in handy the most.
James Brittain
1,675 PointsSee the problem with this one is that I'm confuse as to exactly what the question is asking me to do.
http://postimg.org/image/9m0yq6a59/
I think what I need to do is take all of this code "private SensorManager mSensorManager; private Sensor mAccelerometer; private ShakeDetector mShakeDetector;"
And cut it from the MainActivity Section and put it in its own member class beneath the MainActivity function. Then I can put the member class into the MainActivity and the parameters of the onCreate method.
Could someone please let me know if I'm close because I'm not even sure I understand the question?
Gregory Davis
13,435 PointsYour close with the code you have in the image. Look at the last part of the question about passing a parameter. For what its worth, I follow along in the videos writing the code in Eclipse so when it's time for a code challenge I leave the editor open and use my code as a reference to what is being asked. Take your time and go step by step through the question.
Pierce Puckette
1,473 PointsI thought I was the only one that did that.
Gregory Davis
13,435 PointsEverybody learns in their own way but for me I don't get half as much from just reading or watching a video as I do from getting my hands into it. I comment the project as I go along and it makes for great notes.
James Brittain
1,675 PointsOh, thanks, I actually figured it out. It took me a ridiculously long time of staring blankly at the screen pondering what I'd done wrong, which as some point inevitably became an angsty existential question, but all was put right when I was able to discern the proper answer with a bit of advice.