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 Build a Simple Android App (retired 2014) Learning the Language Objects and Random Numbers

habib kazemi
habib kazemi
2,041 Points

hard to understand completely

until now I watched the videos every thing is strange .There is lots of classes,objects, main,layout... .and I still don't know each ones work! I just get confused .what should I do?

3 Answers

Brian Goldstein
Brian Goldstein
19,419 Points

just keep rewatching the first stage over again until it makes sense to you. do a little googling. if it's not making sense yet, look at how focused you are when you're learning.

http://www.tutorialspoint.com/java/java_quick_guide.htm

Daniel Hartin
Daniel Hartin
18,106 Points

Java can be a bit confusing at first as everything must be defined in a class and you have to start with object orientated programming from the off. How I learnt the real core basics e.g defining variables, loops and defining methods and passing values into those methods was by using Python. Python allows you to declare variables and create simple programs without even defining a method if you want which can really help get a grasp of the basics. I believe there is a tutorial on python here on tree house or will be shortly, above all though be patient learning to program can take a long time, with a lot of headaches and swearing lol.

This will be a bit of a long answer but hope it'll help.

Since Java is the language used to make Android apps it uses Java's way of creating things. Java is an Object Oriented Programming languages which means it uses "Objects" as a way of creating its programs. Classes are like blueprints of objects, for example an Architect would build a blueprint for a house with the number of rooms, windows, colour of the house and how much the house would cost (The objects variables which are describing the object). When a builder gets hold of the blueprints he make loads of copies of the house (Objects.). The whole idea of classes and objects just makes it easier to use your code for future ideals.

With the layout and main (I'm guessing you mean the main_layout?) they are files that Android uses to populate the screen of the phone, tablet or TV with the Texts, Buttons and other Views (Views are what the text and buttons are called.).. The main_layout is the file that populates the first Activity (What the screen of your app is called) of your app.

Really the best thing to do is learn the basic's of Java. The website Brian Goldstein showed it really good to start off with.

Hope it helps a little :)