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

Why 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)

http://teamtreehouse.com/library/build-a-simple-android-app/learning-the-language/introduction-to-arrays

20 Answers

You didnt tell it bestFrog is a string?

Try String bestFrog = frogNames[0];

Hey 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
Ben Jakuben
Treehouse Teacher

Yes, 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.

...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.

C:\Users\James\Pictures\Screenshots\CodeChallenge.png

[screenshot](C:\Users\James\Pictures\Screenshots\CodeChallenge.png)

yeah they dont like to give out the complete answer here buddy

Oh realy? I didn't know anything about that :s

Yep 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.

weird, 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.

Don`t despair man :) you will find your self often in things like that forgetting a quotation mark, bracket, dot or stuff like that :)

Its 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.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

You'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.

http://postimg.org/image/t8yrxsgj7/

I'm missing something here

Hey 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.

While 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.

Programmers 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

Please 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.

Ok, 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

Yeah 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.

See 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?

Your 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.

I thought I was the only one that did that.

Everybody 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.

Oh, 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.