Learning to program (Java)

Dicussion related to software development and coding in general, including various programming languages and platforms.

Learning to program (Java)

Postby TheDeadCpu on 23 Jun 2010, 13:56

So, I've always wanted to program, but I've never really had anything to program..
But now I've decided that I will make a Android app. No matter what.
The thing is that I don't know a single bit of Java coding..
And I don't know what to develop!

Anyone want to help me by suggesting some app I could try to make?
HTC Desire.
Norway (no)
TheDeadCpu
Robocop
 
Posts: 234
Joined: 12 Jul 2009, 15:38

Re: Learning to program (Java)

Postby Edvard on 23 Jun 2010, 20:03

Well, first off I would start with installing and setting up the Android SDK with Eclipse.. Follow Google's great guide here..

To being your adventure in Java, it is more or less mandatory to start off with a simple Hello World app. If I were you I would then start off by making some kind of calculator. A unit converter for example.

You have some nice Java guides here but other than that I would just recommend running through all of Google's really good tutorials here

And of course, if you need any help, just post here and I am sure we can figure it out ;)

Happy coding!
Norway (no)
User avatar
Edvard
Admin
 
Posts: 3105
Joined: 04 Jun 2008, 15:10
Location: Norway

Re: Learning to program (Java)

Postby TheDeadCpu on 23 Jun 2010, 21:20

Yea Eclipse and SDK have been installed for weeks!
I also made a few hello world apps (Which Eclipse technically makes for you)

Now question. I made a small app. With a button. Now I want this button to set my background to a specific color..
Any ideas how?
HTC Desire.
Norway (no)
TheDeadCpu
Robocop
 
Posts: 234
Joined: 12 Jul 2009, 15:38

Re: Learning to program (Java)

Postby Edvard on 26 Jun 2010, 11:03

In the button's onClick listener, just put the following:

Code: Select all
set.setBackgroundResource(R.color.blue); /* Blue is just used as an example here, feel free to pick a different color if you wish */


Sorry for the late reply, hopefully you figured this out already
Norway (no)
User avatar
Edvard
Admin
 
Posts: 3105
Joined: 04 Jun 2008, 15:10
Location: Norway

Re: Learning to program (Java)

Postby TheDeadCpu on 26 Jun 2010, 14:54

I didn't actually, was to busy playing CoD.
Now, doing that gives me Force Close then my Desire freezes. Lol.
HTC Desire.
Norway (no)
TheDeadCpu
Robocop
 
Posts: 234
Joined: 12 Jul 2009, 15:38

Re: Learning to program (Java)

Postby Edvard on 26 Jun 2010, 19:20

TheDeadCpu wrote:I didn't actually, was to busy playing CoD.
Now, doing that gives me Force Close then my Desire freezes. Lol.


Ah, I might have missed out something (never actually set the background color before, I always use graphics).
Code: Select all
final LinearLayout background = (LinearLayout)findViewById(R.id.background);
....


And then in your onClick listener
Code: Select all
background.setBackgroundResource(android.R.color.white);
Norway (no)
User avatar
Edvard
Admin
 
Posts: 3105
Joined: 04 Jun 2008, 15:10
Location: Norway

Re: Learning to program (Java)

Postby faerrleah on 16 Jul 2010, 13:34

If you want to learn Java so you need to JDK, Net-beans or Eclipse IDE and MySQL database. If you want to add button so you have to use Swing in Java. Other option is, you can also use Applet for it. It is very useful application in Java.
United States (us)
faerrleah
Scrap Metal
 
Posts: 3
Joined: 15 Jul 2010, 18:35

Re: Learning to program (Java)

Postby Edvard on 19 Jul 2010, 16:37

Ive used Eclipse almost exclusively for Java development but a guy I know swears to Netbeans.. What's your take?
Norway (no)
User avatar
Edvard
Admin
 
Posts: 3105
Joined: 04 Jun 2008, 15:10
Location: Norway


Return to Software Development and Coding

Who is online

Users browsing this forum: No registered users and 1 guest

accesskey="z">