Tuesday 30 November 2010

Installing android SDK and ADT plugin for Eclipse IDE

The easiest way to get started in developing Android apps is to use the Eclipse IDE with android SDK and ADT plugin. There are simple instructions on the android developers site, however to confirm the steps are as follows:

1. Install Eclipse IDE, see Installing eclipse IDE

2. Download the SDK starter package.
Extract the contents and save to a directory. Your home directory is safe place where you'll be able to find it later on.

3. Download and install the ADT plugin. This is very simple in Eclipse.

a. Launch Eclipse, Click Help, Install new software.

b. Click the option to add available software and type the following in the add site field:

https://dl-ssl.google.com/android/eclipse/ 

c. Click OK, then back in the available software list you will see Developer Tools. Selecting the check box for this will add Android DDMS and Developer Tools.


d. Click next, accept any licence agreements, then press finish. Eclipse will restart. 


4. a Finally to configure the ADT plugin. Go to preferences, available under the window tool menu.


b. Select Android, and for the SDK location browse to the saved directory you have from earlier.


c. Click apply, OK.


SDK and ADT plugin for eclipse are complete.

Installing Grails on Linux

Before installing or using Grails, set JAVA_HOME environment variable:

1. Add the following to  ~/.profile

export JAVA_HOME=/usr/local/jdk1.6.0_27/
export PATH=$PATH:/usr/local/jdk1.6.0_27/bin

Location will be where JDK is installed to.

2. Log out and back in again, run echo $JAVA_HOME and echo $PATH to confirm. Also check by typing java -version.

To install Grails:

1. Download grails from http://www.grails.org/Download
2. Extract the archive into a home directory. Typically /usr/local in Linux
3. Append a reference to grails as a variable, as with JAVA_HOME above

export GRAILS_HOME=/usr/local/grails-1.3.7/
export PATH=$PATH:/usr/local/grails-1.3.7/bin


Location path will be the directory you saved the extracted files to.

4. Log out and back in again.
5. Type grails in a terminal window to test. You should see:


Welcome to Grails 1.3.5 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /home/lee/grails-1.3.5

No script name specified. Use 'grails help' for more info or 'grails interactive' to enter interactive mode


You can now begin writing grails applications

Installing Eclipse IDE onto Ububtu Linux

Rather than just using a basic text editor for writing java language applications, or an other programming language, it is always good to use an IDE. The following explains how to install the Eclipse IDE on an Ubuntu machine. Similar setup applies to most Linux flavors:

1. Download eclipse from the download site, http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr1

2. Extract the contents:
tar xzf eclipse-java-helios-SR1-linux-gtk.tar

3. Moved the extracted contents to /opt
sudo mv eclipse /opt/eclipse

4. Change permissions and create executable
sudo chmod +rx
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudoedit /usr/bin/eclipse

Input the following contents:


#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $* 


5. If you want a menu item:
sudoedit /usr/share/applications/eclipse.desktop

with the following contents:

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true



Now run from the programming menu under applications. 

Writing your first Java application

In order to test if your Java JDK installation is working correctly the best thing to do is write a simple Hello App!

1. Open a terminal window
2. Create a new java file, e.g. vi Hello.java
3. Write a basic program to announce some text or comment:

public class Hello {
        public static void main(String[] args) {
                System.out.println("I am a java App!");
        }
}


4. Save the file
5. Run javac Hello.java (This should complete without any errors)
6. Run java Hello
7.  I am a java App! appears in the terminal

Installing Java SDK Linux - Ubuntu

Having never used Linux before when you first starting using any Linux flavor, even the most simplest of tasks performed under Microsoft operating systems can cause you some trouble.

For programming and general purpose user I required  Java JDK and JRE installed on my Ubuntu machine. See basic steps below on how this install takes place.

Installation of Java JRE

You can download the source code or self extracting binaries from the Sun Java site, however the quickest way on this OS is to complete the following:

1. Open a terminal window
2. Run sudo vi '/etc/apt/sources.list'
3. Add the following line to the bottom of the file:
deb http://archive.canonical.com/ lucid partner
4. Run sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
5. Accept all license terms etc..
6. Run java from terminal window to confirm installation

Installation of Java JDK (for developers)


You can download the source code or self extracting binaries from the Sun Java site, however the  quickest way on this OS is to complete the following:

1. Open a terminal window
2. Run sudo apt-get install sun-java6-jdk
3. Run java -version to confirm installation

Introduction

I intend to use this blog to write simple instructions and setup procedures that I have completed in order to get various IT solutions in place.
I will document basic software installations right through to steps taken in order to get various applications to communicate with each other.

Having worked as an IT Support technician for Microsoft based products I decided that it was time for a complete turn around and for me to learn Unix, Linux, open source solutions and programming.

Not only will this be a reference for all you, I can use this blog as as documentation for myself if I need to complete these installations again.