views:

77

answers:

3

Hi,

I wonder if someone can help me... I've been developing VB.Net for years and C++/VB before that. I've also got some PHP experience. I'm now moving to Java to write an app for my Android mobile. I'm trying to use MOTODev Studio (Which extends eclipse)

I've not developed in Java before so it's a bit of a learning curve anyway. I'm fairly confident I'll be able to work out the important bits but I'm in a new IDE in a new language developing for a new platform.

As I'm new to Java, I was hoping to be able to rely on auto-code generation, intellisense, etc. I'm starting to think this was either very optimistic or I'm using eclipse very poorly.

For example, I know I need to override the OnClickListener() event but am unsure of the exact syntax. In VS, I'd just start typing Override in a class and up would pop intellisense with everything I can override and the appropriate signature, however, in eclipse none of the intellisense options seem to apply when I type public voidor @Override. Is this because I'm doing something wrong/is eclipse intellisense incomplete not very good?

In VS there's a bar at the top of the code page which lists objects in the file on the left and methods of the current object on the right. Does eclipse have an equivalent? If so, where?

I've managed to use the IDE to the extent that I've got a "Hello World" installed on my mob so it's more code generation techniques than windows/dialogues/etc.

I suppose what I really need is for someone to recommend some good resources to help me transition. I'd also appreciate any comments or advice from others that have done similar

Thanks in advance

+2  A: 
  1. http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html

  2. yes, it's the default java perspective. Have you even installed the IDE yet?

  3. http://www.vogella.de/articles/Eclipse/article.html

Falmarri
1. Thanks. 2. Yes - hence being able to build Hello World and run it in the Emulator/publish to phone 3. Looks handy - thanks again
Basiclife
+2  A: 

So you learning three items at once

  1. Language (Java)
  2. Platform (Android)
  3. Tool (Eclipse)

Here are my two cents for each of them:

  • Java - besides annotations guide already mentioned by Falmarri all java tutorials on oracle site are worth seeing you can find them here

  • Android - From my point of view very good entering points into android development are Android Developer Dev guide and API Demos project which demonstrates many android aspects ( You can add this project into your workspace in Eclipse via ->New Android Project-> Select from sample ->Choose target version -> Click OK , Voila you have new project in your workspace with a lot of useful android related code, describing many advanced and not so advanced topics). BTW Android developers blog is worth reading but it usually covers more advanced topics

  • Eclipse - Falmarri already pointed and pretty good tutorial about Eclipse, I from my side would suggest to start from Help-> Help Contents -> Java Development User Guide
    It covers all basic tasks and concepts. For your particular problem with overriding ( actually implementing) an interface method you've to first indicate that your class implements View.OnClickListener via class MyClass implements OnClickListener at this point eclipse will notice that you claiming to implement interface but didn't actually implemented some of it methods ( in this situation onClick(View v)) and will mark class declaration with error marker. Go to your class declaration and press Ctrl + 1 ( also known as "quick fix") and you will get some options to fix broken code. At the other hand if you really want to override parent class method you can press Ctrl + Space in a class body ( e.g not inside the method) and you will get option to override avalible methods.

Hope it helps

Nikolay Ivanov
You can also hover over any error marker and it will list the quick fixes available.
Austyn Mahoney
Yes I know that, but I'm more like more keyboard less mouse person
Nikolay Ivanov
Very handy - thanks :)
Basiclife
+1  A: 

I'm not entirely sure I fully understand your questions, but if I'm in a Java class in Eclipse that implements some Interface and I want to implement methods I either select the quick fix (Ctrl+1) for the compiler error telling me I'm not implementing the Interface or I trigger content assist (Ctrl+Space) in the class body to get a list of methods to override. And with the bar you mention, do you mean something like the breadcrumb navigation (Alt+Shift+B)?

Fabian Steeg
+1 That was really helpful, thanks
Basiclife