Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm new to all this game developing, and I'm starting to learn java because I was told it was a great way to start. I want to later on create games for the android market, and want to get a good view from you guys, so I know what I'm dealing with exactly.

I DO realize that Android development has different architectures and whatnot (that a good way to say it?)

Thanks!

share|improve this question
4  
For what it's worth, Android applications are typically written in Java. The difference between the two is that "Android" is an operating system and "Java" is a programming language. They serve different (non-overlapping) purposes. –  dash-tom-bang Oct 7 '10 at 0:10
    
Clarified OP's question title. –  Nick Wiggill Sep 10 '11 at 9:55

2 Answers 2

To create Android applications you use Java and the extension libraries that Android provides. These aren't extensions in the Java Language sort of way; I mean libraries that are shipped with Android to help you achieve the common things you'd want to do on a cellphone.

For example, Blackberry (another Java-based mobile OS) uses Java as the language of choice, and Research In Motion provides a set of libraries in the RIM package that helps me abstract things that I'd commonly do on my phone.

You can use pure Java but most of the time you want to use the RIM libraries provided by RIM.

If you're completely new to programming I would recommend first learning good Java principles - classes, methods, object-oriented programming, etc; then learning the Android API provided by Google. If you learn Android first you'll get confused quick and not follow good programming practices.

I recommend starting with the book Head First Java.

share|improve this answer
    
+1 for the Head First Java referral. –  Patrick Hughes Sep 10 '11 at 19:23

Android uses its own Java like implementation. You write Java syntax code and can use Many Java APIs, but there are many differences:

  • Android applications have a special Lifecycle:
    • no main function
    • your applications contains Activities with onCreate, onResume, onPause, onDestroy functions that you must override
  • Code is compiled into Dalvik opcodes (not java byte code);
  • Many APIs are similars but you don't have all J2SE APIs. You must check on the developper site;
  • Many APIs are limited to Android (Contacts, Power Management, Graphics...);
  • IHM are android onlys (no Swing, no JavaFX ...). You must use XML to declare you GUI;
  • you can use java jars (if they use only compatible APIs) but they are converted into dalvik.

So, it is like a new platform; but, if you know Java, it is very easy to develop on Android. Download the SDK and try to play with provided samples and customize them. You can use good IDE as Eclipse and Idea (Android plugin will arrive in Idea 10 Community editions).

For C/C++ geeks, you can use NDK (Native Development Kit) but you need some Java bootstrap code and JNI knowledge.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.