• 0

Learning Android. Best place to start.


Question

Hello,

I am a moderate to advanced user of VB6 and moderate user of VB.Net. Mainly in using VB as a front end to manipulate databases (SQL server & Access)

I would like to get into the world of mobile programming.

Yesterday I downloaded the Android SDK and Eclipse.

I tried to do the hello world example (2nd part using an input box and responding to user interaction) that was on the android site but the tutorial seemed to assume a lot. Mostly that you understand JAVA and the Java programming concepts, even though android seems to be a derivative of JAVA

I felt as though I needed a better grounding.

Could anyone recommend a good tutorial (on line or book) that would be a good place to start. I think the best approach would be starting from scratch as total novice.

Is it worth getting familiar with Java first?

Thank you in advance.

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

You need to be familiar with the Java programming language. The Android SDK is just a set of libraries and tools to allow you to target Android platforms, the programming language is still just Java. If you understand VB.Net then Java should be a straightforward transition.

This is the best Java learning book I know of: http://www.greenteap...thinkapjava.pdf

  • Like 1
Link to comment
Share on other sites

  • 0

If you pick up Java and understand it, I think the next step is XML; XML is a bitch in Android and its something you pretty much will have to get use to (not only in Android but in other programming languages)

If you understand VB.Net then Java should be a straightforward transition.

I semidisagree.

Link to comment
Share on other sites

  • 0
I semidisagree.
Why? They're both statically typed, imperative, object-oriented languages compiled to bytecode and running on a VM. The environment and syntax differ but the semantics are essentially the same.
Link to comment
Share on other sites

  • 0

The language itself is pretty straight forward, and if you already know OO concepts, it's just a matter of learning the Android SDK and java library/API's.

It's very different to VB though. It's far closer to C++ than it is to VB.

Link to comment
Share on other sites

  • 0
It's very different to VB though. It's far closer to C++ than it is to VB.
Certainly not:

- Both Java and VB compile to bytecode, C++ compiles to native code

- Both Java and VB run on managed environments, C++ runs natively

- Both Java and VB are garbage-collected, C++ requires manual resource management

- Both Java and VB are based on an extensive class library (Java/.NET), C++ doesn't

- Both Java and VB are single-inheritance, multiple interface, C++ is multiple inheritance

- Java and VB have no headers and no link step in compilation, unlike C++

- Java and VB have similar generics, C++'s templates are a completely different beast

- C++ has a ton of features absent in both Java and VB: unsafe pointers, non-nullable references, global variables, macros, static locals, friend members, protected/private inheritance, unions, inline etc.

- The philosophies and purposes are entirely different: C++ never compromises on control and performance, VB and Java are designed for programmer productivity and safe code

The similarities between Java and C++ are superficial - keywords, braces - the semantics and behaviors are completly different and much closer to VB.

Link to comment
Share on other sites

  • 0

- Both Java and VB compile to bytecode, C++ compiles to native code

- Both Java and VB run on managed environments, C++ runs natively

Depends which VB you're talking about. VB 6 binaries can run natively. Irrespective of that, I'm talking about language similarities, not what goes on behind the scenes, which the programmer shouldn't be too concerned about anyway.

- Both Java and VB are garbage-collected, C++ requires manual resource management

Heard of smart pointers or automatic variables? But again, that's off topic. Garbage collection and automatic variables are handled by the language and their inner workings shouldn't concern the programmer.

- Both Java and VB are based on an extensive class library (Java/.NET), C++ doesn't

STL? Boost?

- Java and VB have no headers and no link step in compilation, unlike C++

- Both Java and VB are single-inheritance, multiple interface, C++ is multiple inheritance

- Java and VB have similar generics, C++'s templates are a completely different beast

- C++ has a ton of features absent in both Java and VB: unsafe pointers, non-nullable references, global variables, macros, static locals, friend members, protected/private inheritance, unions, inline etc.

- The philosophies and purposes are entirely different: C++ never compromises on control and performance, VB and Java are designed for programmer productivity and safe code

Again in terms of the language, syntax, exceptions, etc, Java is much more like C++ than VB. You only have to spend five minutes

with it to glean that. Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation, and he achieved that.

The similarities between Java and C++ are superficial - keywords, braces - the semantics and behaviors are completly different and much closer to VB.

The whole syntax is based on C/C++, I'd hardly call that superficial. Would you call the exception system superficial as well? The java library also has hallmarks of the STL.

Link to comment
Share on other sites

  • 0
Irrespective of that, I'm talking about language similarities, not what goes on behind the scenes, which the programmer shouldn't be too concerned about anyway.
Whether or not you can afford to run on a managed environment and give up control over memory management is the #1 reason to use either Java or C++. This deeply concerns the programmer. You may not need to understand all details of how the Java environment works, but you certainly need to understand what it does as a black box at least. You simply cannot program C++ like you program Java or vice-versa. VB and Java are much more similar in this regard.

C++ is not based on STL or boost, they are simply libraries available to it on the same level as any other library. The Java and VB languages are based on their respective base class libraries, i.e. they are defined in terms of the types contained within these libraries, and in terms of the services provided by their environments, which are similar.

Smart pointers are just a type you can use in C++, the language itself doesn't provide or assume GC unlike Java and VB which deeply affects how programs are designed in these languages. While it's not too important to know about the inner working of these mechanisms, the fact that a language is garbage-collected or not deeply affects the design of programs and algorithms. This concerns the programmer to the highest degree.

Java and C++ share superficial syntactic similarities, such as keywords or usage of braces to denote scope. This is relatively unimportant from a programmer's point of view compared to what these keyword mean, i.e. semantics. A C++ class is nothing like a Java class, which is much more similar to a VB class; C++ classes are compile-time constructs, VB and Java classes are fully reflectable run-time entities; C++ classes just define a memory layout, this is opaque in Java and VB, etc. Programming in C++ requires an entire different set of skills and design principles than programming in Java, and if you treat both similarly then you probably know little of these languages.

Since you mention exceptions, they are much more similar between Java and VB then between Java and C++. C++ can throw anything, Java and VB have to throw exceptions derived from java.lang.Throwable and System.Exception respectively; C++ offers exception safety through RAII, Java and VB do it through finally blocks; C++ exceptions are optional, they are not in Java and VB.

Besides I mentionned several syntactic and language rules differences that are very important (headers, inheritance, macros, static locals, friends, templates, pointers, references) which you simply gleaned over... and yes of course I'm talking about VB7 and above. At this point VB6 is 14 years old.

Link to comment
Share on other sites

  • 0

...

Besides I mentionned several syntactic and language rules differences that are very important (headers, inheritance, macros, static locals, friends, templates, pointers, references) which you simply gleaned over... and yes of course I'm talking about VB7 and above. At this point VB6 is 14 years old.

That's all well and good, and we can agree to disagree, but the OP specifically stated:

I am a moderate to advanced user of VB6 and moderate user of VB.Net

So he's obviously using VB6 (as are a lot of people), and is more experienced in it. I know you like to pretend that it doesn't exist and dotNET is the only thing people use in the world, but I'm afraid that isn't the case.

To the OP, learning the basics of Java and OO are quite important if you want to write good Android apps. I find it best to write terminal only code to start with and avoiding UI's, until you get familiar with the language and its library.

Link to comment
Share on other sites

  • 0
So he's obviously using VB6 (as are a lot of people), and is more experienced in it. I know you like to pretend that it doesn't exist and dotNET is the only thing people use in the world, but I'm afraid that isn't the case.
And he's obviously also using VB.NET although less experienced in it. Your point?
Link to comment
Share on other sites

  • 0
I find it best to write terminal only code to start with and avoiding UI's, until you get familiar with the language and its library.
That's terrible advice especially for a VB user who is already used to a visual environment. And in general, features like compile-run-debug in one keystroke, semantic syntax highlighting, auto-completion and background compilation make it much easier for a beginner to learn a language and its libraries. I cannot fathom how the absence of these helpers and the necessity of learning the command-line interface of a compiler is supposed to make it easier for a beginner.
Link to comment
Share on other sites

  • 0

I cannot fathom how the absence of these helpers and the necessity of learning the command-line interface of a compiler is supposed to make it easier for a beginner.

Because learning all that can be overwhelming at first. It's also distracting and unnecessary if one just wants to familarise one's self with the language and main library. I use eclipse for Android development, but I also use the cli for trying out stuff with the language without the overhead of an IDE, its configuration, and how it gets between me and the compiler.

That's my personal preference anyway. I adopted the KISS principle years ago, both in development and how I approach things generally. Ideally I'd also like to do Android dev on the cli, but that's a real pain.

Link to comment
Share on other sites

  • 0

Because learning all that can be overwhelming at first. It's also distracting and unnecessary if one just wants to familarise one's self with the language and main library. I use eclipse for Android development, but I also use the cli for trying out stuff with the language without the overhead of an IDE, its configuration, and how it gets between me and the compiler.

That's my personal preference anyway. I adopted the KISS principle years ago, both in development and how I approach things generally. Ideally I'd also like to do Android dev on the cli, but that's a real pain.

What "overhead"? What "configuration"? If your IDE adds overhead and configuration compared to doing things by hand I'd say you're using the wrong IDE. A good IDE makes things much more simple than doing things by hand with barebones tools. I can compile, run and debug in one keystroke. I can immediately see my errors as soon as I enter the code. I can tell what the different words mean in the code simply by their color. I can learn an API without my leaving my code, simply by "dotting into" objects and looking at the auto-completion options and tooltips. Without an IDE I have to learn a serie of manual steps to do every time I want to compile and run, a compiler command-line interface, care about where my files are located on disk, where the binaries go, non-highlighted code is much harder to read, etc.
  • Like 2
Link to comment
Share on other sites

  • 0

That's terrible advice especially for a VB user who is already used to a visual environment. And in general, features like compile-run-debug in one keystroke, semantic syntax highlighting, auto-completion and background compilation make it much easier for a beginner to learn a language and its libraries. I cannot fathom how the absence of these helpers and the necessity of learning the command-line interface of a compiler is supposed to make it easier for a beginner.

If I'm learning Java (the language), I would personally find it easier to just use my favorite text editor and javac on the command line. At that point:

  • I am a beginner at Java.
  • I am not a beginner at my favorite code editor.
  • Learning Eclipse would be a cognitive overhead that I don't need.
  • I don't care about about how I organise a "project" since the stuff that I'm writing simply live in a few text files.

Once I'm confident with Java, I'd then switch to Eclipse since that's how Google has set up Android development. On the other hand, if I'm coding Java with the Play framework, I'd simply keep using my editor plus the command line tools that Play provides, since that's how Play is set up.

So, personally for me:

Using a text editor is easier and simpler when learning a language.

When learning a framework, use whatever tools the framework wants to be used with. That may involve an IDE or a set of command line tools, but it is always better to work with the tools provided with the framework than trying to make the framework work with your existing tools.

Link to comment
Share on other sites

  • 0

I was in the same boat as you. I grew up learning a bit of basic, then moved to visual basic, then VB.net. I started dabling in android, and it was a huge hurdle to figure out. Don't know if it's been mentioned yet, but stackoverflow.com is a great resource as well. Don't get discouraged by people telling you you MUST know java before hand, you can learn as you go. I'm working on my second app, and have learned a lot as I've developed it, and while I'm far from an expert, I've learned quite a lot from reading samples and postings on various blogs, the developers guide, and from stack overflow questions.

  • Like 1
Link to comment
Share on other sites

This topic is now closed to further replies.