Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am learning Java and I was wondering about when it would be best for me to try to develop something for Android? I have two specific concerns.

1.How is the Android API different from the main Java API? Are they similar or radically different?

2.I have heard that you need to make multiple versions of a given application for different devices. Is this correct?

I have no idea where to start when answering these questions.

share|improve this question
    
Probably better to post your question here. –  Bernard Aug 10 '11 at 2:12
    
yes sure, thank you –  arrrrgv Aug 10 '11 at 2:15
    
@Bernard Android Enthusiasts is about using Android, not developing for it. They do not accept development-related questions. –  Anna Lear Aug 10 '11 at 2:19
    
@Anna Lear: My apologies, I was not aware. –  Bernard Aug 10 '11 at 2:21
1  
Right now, you aren't making Oracle happy when saying "Java and Android" :) –  Chiron Aug 10 '11 at 9:21
add comment

3 Answers

Android is not a language or a subset but an API

The Android API is written for the java language. The android developers system requirements can be found below. Which outlines the specific version of java and eclipse, etc that you will need to be able to build android applications.

Supported Development Environments Eclipse IDE

Eclipse 3.5 (Galileo) or greater

Note: Eclipse 3.4 (Ganymede) is no longer supported with the latest version of ADT. Eclipse JDT plugin (included in most Eclipse IDE packages) If you need to install or update Eclipse, you can download it from http://www.eclipse.org/downloads/.

Several types of Eclipse packages are available for each platform. For developing Android applications, we recommend that you install one of these packages:

  • Eclipse IDE for Java Developers
  • Eclipse Classic (versions 3.5.1 and higher)
  • Eclipse IDE for Java EE Developers
  • JDK 5 or JDK 6 (JRE alone is not sufficient)
  • Android Development Tools plugin (recommended)
  • Not compatible with Gnu Compiler for Java (gcj)

Devices may be running different versions of the Android OS

As you can imagaine as the Android OS has evolved so has the API to be able to give developers the option of targeting new devices capable of running the latest features. So too are these new features unavilable on older devices and so are incompatible with those devices.

Code in graceful feature deprecation

What you have to decide as an android developer is what features you want in your appliction will determine what devices you can support. And if you wish to support a wider variety of devices you will then have to write code to detect device version and safely disable portions of your code that will use incompatible features on older devices.

The google developers have clear guidelines as to what features are supported in new devices and working with backwards compatibility is up to the developer to ensure that it works as intended.

When can I start learning android?

Pretty much anytime you like, from one of your other posts I see that you are already familiar with C#. Java is very similar to C# (chronologically it's the other way around iirc) in a lot of ways and what differences there are can be minor in a lot of ways (no LINQ, and different support for generics) etc.

However those differences should in no way impact your ability to learn java and apply that knowledge to writing android apps. Almost like winforms android has it's own way of doing things which will determine what techniques you will need to use to get your desired functionality.

share|improve this answer
add comment
  1. The Android development platform makes use of a subset of the Java programming language, simply because a mobile device is more limited than a standard computer. You won't have to deal with differences in the language, only what you can use from it in order to develop for Android.

  2. Because Android is an open platform used on various mobile devices, each device will be slightly different (e.g. screen resolution). Not only will you have to take this into consideration when developing for Android, but you also have to consider the version of the Android platform that the mobile device is using (i.e. not all devices use the latest version of Android).

share|improve this answer
add comment

The android api is slightly different from regular java. For example, most likely, your used to creating Swing (or even awt) applications, in which you create the GUI in the java code. In android programming, you create your UI in XML and give each element an ID that you call in your code. this makes everything more dynamic. In addition, Android programming is probubly closer to applet programming than regular Swing programming, in that instead of one main method, there are several different methods. one for creating, one for starting, one for stopping, and one for destroying the application.
for Creating, it is:

    @Override
       onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
       }

then for starting, there is a:

    @Override
       onStart() {
         super.onStart();
       }

then for stoping, there is a:

    @Override
       onStop() {
         super.onStop();
       }

then for Destroying the application there is:

    @Override
       onDestroy() {
         super.onDestroy();
       }

while all of this may seem different, it is relatively easy once you get the hang of it. I learned simply by reading Android Application Development For Dummies, that's what I would recommend. it's not all that different from regular java once you get passed the layout and life cycle.

share|improve this answer
add comment

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.