Search This Blog

Wednesday 28 March 2012

Mastering the basics

I know that some of you more experienced programmers will be keen to get started with Android programming.  I will do one or two more posts for the complete beginners before sending them off to acquire the required java skills.  The rest of us can then continue on our Android journey and the beginners can catch up.

So you have now downloaded eclipse - what next.  In Eclipse you should find a hello world tutorial.  Try following this (It is traditional for the first program to be the hello world program).  Also spend a bit of time just playing with Eclipse and looking at some of the introductory sections of the help.

Then try searching the internet for 'java tutorials for beginners'.  Work through some or these tutorials.  So far you have not spent a penny.  At this stage you may want to invest in a java book for beginners, alternatively you could borrow one from the library.  I usually go for books like 'java for dummies' or 'learn java in 24 hours'.  I find that these books are an easy read and the chapters are in manageable chunks.  Take your time working through a beginners book, you will need a sound grasp of the basics before you start Android programming.

When working through a book it is a good idea to know what concepts you are trying to learn.  You need to develop an understanding of the following concepts:

If Statements
Loops (for, do, while)
Data types (Integers, doubles, strings)
Structures and Arrays
Writing functions

More advanced concepts that you will need to master include:

Classes
Objects
Inheritance, Encapsulation, Polymorphism.

This is not an exhaustive list of concepts.

Programming skills require practice.  In order to practice your newly acquired programming skills try and come up with a few projects for your self.  Use your book and the internet to complete your project.

The projects don't need to be complex.  For example to practice loops you could write a program which asks the user to enter a number.  The program could then loop that number of times, writing 'I love you' to the screen that many times (Just be careful about who you ask to test this program).  Another project to practice if statements may involve randomly generating a 3 digit number and then asking the user to guess it.  An if statement would be used to test if the user entered number is greater than or less than the generated number.  The program would loop providing appropriate feedback to the user until the number was guessed.

The basic concepts that you learn are common to all programming languages, only the syntax changes.

You will also need to learn how to debug programs.  This will involve understanding breakpoints, stepping through code and watching variables.  Play about with Eclipse to see if you can work out how to do this.

Now go and learn java.  Good luck, remember Google is your friend - however if you can't find the answer to your question via Google, then feel free to post it on this blog (You can use comments to post questions).  I will do my best to answer the question, if I can't answer it then I am sure somebody out there will be able to.  Also any general feedback that you want to give me will be greatly appreciated.

Enjoy learning java, until next time - Good bye

No comments:

Post a Comment