RSS

Tag Archives: eclipse

Eclipse Shortcut Keys for Android Development

One of the main things holding me up from picking up Android development is the fact that it’s using Eclipse as its IDE. Android Studio is still in Beta, so I stick with Eclipse.

But, what’s wrong with Eclipse? You how it feels when you get out of your comfort zone, well, it’s uncomfortable! I am a hard-core Visual Studio user, so when in Eclipse, I feel like I was put in Mars!

Finally, I figured what alienate me from Eclipse, it’s because I can’t do what I can in Visual Studio, or more like, I haven’t found the way to do it yet.

As I code in Eclipse now, I carefully learn what I would normally do in Visual Studio that I couldn’t in Eclipse, then stop and find a way to do it in Eclipse. Turns out, there’s always a way to do what I have been doing in Visual Studio. Most of these are shortcut keys.

So, here’s the Windows shortcut keys for Eclipse for most things I do in Visual Studio:

Track item in Package Explorer

Click a “two yellow arrows pointed at left and right” button in the Package Explorer view. The button is “Link with Editor” button.

Stop running instance / process

  • Windows > Show View > Other > Devices
    Show Devices view.
  • Select instance / process
    Select an instance / process from the list under each device.
  • Stop Process
    Click on STOP icon from View menu.

Find All (in Project / Solution)

CTRL + H
Use File Search

Switch between file tabs

  • CTRL + Page Up / CTRL + Page Down
    Go to previous / next file in the Editors list.
  • ALT + Left / ALT + Right
    Go to previous / next file on history basis.
  • CTRL + E
    Show list of tabs to pick from.
  • CTRL + F6
    Switch to previous file on history basis.

Comment / uncomment

  • CTRL + SHIFT + /
    Comment.
  • CTRL + SHIFT + \
    Uncomment.

Go to line

CTRL + L

Close file tab

CTRL + W

Go to type / class

CTRL + SHIFT + T

Show intellisense while typing

CTRL + SPACE

Find next / previous

  • CTRL + K
    Find next.
  • CTRL + SHIFT + K
    Find previous.

Format code in Editor

CTRL + SHIFT + F

Delete whole line

CTRL + D

Go to declaration

F3

Organize (delete / add) imports

CTRL + SHIFT + O

Search method

CTRL + O

Rename method / class

SHIFT + ALT + R

Maximize / restore editor area

CTRL + M

 
Leave a comment

Posted by on September 29, 2014 in General

 

Tags:

Developing Android App: Setting Up Environment

I had a chance to toy around Android Development Tools (ADT) over the weekend and this is my personal take on it: aside from setting up Eclipse IDE, everything works painfully. Although, I have to admit, setting up Eclipse IDE for me wasn’t as painful as Jamie Murai’s experience with RIM Developer Relations, not even a slight chance.

This is what you need to do:

Download Android SDK
Download Android SDK here. The download already include Eclipse IDE with ADT plugin.

Run Eclipse (Mac and Windows)
Ideally, you just click on “eclipse.exe” file and you are ready to develop app in Android. This is true when I ran Eclipse on Mac OSX environment. For Windows, it’s not the case. In¬†Windows environment, I ran into couple issues

“Java Runtime Environment ¬†/ Java Development Kit must be available”

developing-android-app-setting-up-environment-1

To solve this:

  • Right click on My Computer, Properties
  • On Advanced tab, click on Environment Variables
    developing-android-app-setting-up-environment-2
  • Under System Variables, add the following variable:
    key: JAVA_HOME
    value: C:\Program Files (x86)\Java\jre7
    Obviously, the value depend on where you have your JRE installed and what version (32 or 64 bit), but normally this is where it is.
  • Under System Variables, modify the Path variable:
    key: Path
    value: ;%JAVA_HOME$\bin
    developing-android-app-setting-up-environment-3

“Failed to load the JNI shared library.”

developing-android-app-setting-up-environment-4

This caused by different system type between Java Runtime and Eclipse. In my case, I have 32-bit Java Runtime but 64-bit Eclipse. Both Java Runtime and Eclipse must match, either 32-bit or 64-bit.

Android Virtual Device (AVD)
Your journey is not yet ended after you get Eclipse to run. Before start coding your app, you will need to create what is called Android Virtual Device (AVD). Essentially, it’s a sandbox, closed, isolated environment of an Android device. So, think of it like a Android cell phone but running on your OS.
Android Developers site provide details information on this subject: Managing AVDs with AVD Manager.

I would strongly suggest you to run your app on actual device as oppose to emulator in AVD just because running emulator is extremely slower in my case.

What’s Next?
Well, create your first app and hello world fun. Head to tutorial on Android Developers website to create your first app.

 
Leave a comment

Posted by on February 11, 2013 in General

 

Tags: ,

 
%d bloggers like this: