tags:

views:

431

answers:

5

Should I learn Java before learning Android or I can do both things in parallel? What is the best approach?

+2  A: 

0% accept rate is pretty harsh... but anyways, learning is always easier when you have a goals to work towards. If your goal is to do primarily Android programming, focus on that and you'll pick up Java on the way.

Robert
And for your next act, you might want to write a book in Chinese. Don't bother learning anything about it first - I'm sure you'll pick it up along the way. Seriously, it's going to be *much* easier to learn Java in an environment which makes it easy to play with, write console apps in etc. When the OP runs into a problem while writing an Android app, it's going to be *really* hard to diagnose what's going on if he doesn't know the language beforehand.
Jon Skeet
I thinking comparing learning a specific use of a programming language to writing a book on a spoken langauge is a bit harsh. Last time I checked Android uses Java, so I found it pretty obvious that my meaning was to learn Java and Android at the same time, rather than focus 100% on Java, then turn to Android.
Robert
@Robert: But learning to platform on a mobile environment (or indeed learning pretty much *any* advanced client UI technology) when you don't know the language is much trickier than learning the core of the language in a simpler environment and then moving on to the harder version of the platform. I would strongly advise *against* trying to learn two significant things at the same time.
Jon Skeet
Again I wasn't expecting him to dive into Android programming with no knowledge of Java at all, I simply meant that he shouldn't focus on Java and neglect Android. Just my personal opinion and experience in the past as I pick up a language/platform much more quickly with a project to work towards. He did not mention if he had any previous programming experience or not so I based it off my opinion.
Robert
Well, you said to "focus on Android" - that suggests *precisely* that he should dive into Android with no knowledge of Java. I view the eventual goal of Android as a reason not to bother learning any servlet / Swing stuff... but *not* a reason to skip learning the core of the language first, in as simple a context as possible (e.g. a console app).
Jon Skeet
I am unsure of the intent of your comments, is it to provide the OP with valuable information or to attempt to bash me? If the latter, my position remains that my learning style would be to take up both at the same time as I would be curious as to how I would use the Java in tandem with Android. As such, depending on his prior programming knowledge, this approach may work for him as well.
Robert
+11  A: 

I would absolutely learn Java first. Don't bother learning things like servlets, Swing etc - but learn:

  • The core language
  • Collections
  • IO
  • String handling

Trying to learn these while also learning a completely new environment will make it a lot harder to work out where you're going wrong.

Note that this isn't specific to Android - I'd always encourage developers to learn the "core" of a new platform before learning "peripheral" technologies such as native UIs or web frameworks.

I've seen people try to do this before - literally asking complicated questions about advanced scenarios, while not understanding the basics of the language. Sometimes the problem they've been having has been due to the complex API they were using, and sometimes it's been due to the basic misunderstandings - but the problems looks exactly the same to them. They can't tell the difference between not understanding how method arguments are passed, and having difficulty with cross-threading UI operations. As far as they're concerned, "something has gone wrong." Every step is painful when you don't have a solid foundation.

Aside from anything, as boring as console applications with no interaction might be, they're really great for just testing something quickly. You typically don't need to worry about threading, permissions, graphics, resources etc. Another good way to test your understand is via unit tests. Rather than a normal test-first approach, write a method and predict its output with unit tests, until you run out of interesting situations to test. Once you're done, you've got a complete record of what the code does - keep it for later on, in case you need to revisit the concept you were testing.

Jon Skeet
A: 

The tutorial given in the Android Developer Website is hard to understand if you don't know anything about java. I'd recommend starting with Java basics and then go on with Android. It would be the best way to understand everthing in an easier way.

In Java, you'll also have to focus the way to do things efficiently because mobile battery is a matter to take into account in mobile applications.

Javi
A: 

if you know c# ,you can start android now

laolaowhn
A: 

Yes I would learn at least the basics of Java prior to starting on Android.

Starting in Android would be like learning to scuba dive before learning to swim, sure you could probably struggle your way along, but you'll be making the process unnecessarily more difficult for yourself.

phalewail