Sunday, October 12, 2014

Ubuntu 14.04.1 Post-Install Setup

Introduction

This article serves as a guide for the user of a just-installed Ubuntu 14.04.1 PC or notebook to set up the system properly. It is applicable to both the 32-bit and 64-bit system.

After the installation of Ubuntu has been completed and the system boots up for the first time, the user will be presented with the login screen. Log into the system using the user name and password specified during the install process and, if successful, the user will be presented with the Unity desktop as shown below. Click on any item on the launcher to dismiss the keyboard shortcut pop-up window.


Now it's time to carry out the post-install setup of the system. The setting up will vary according to individual tastes - you do not have to follow all the steps outlined in this article. Simply view this article as a guide to setting up the system after installation. Keep this in mind - there is no "perfect desktop" for everyone - each desktop may differ according to the taste of the individual using the system. There are, however, some things that need to be carried out by everyone after installation - for example, updating the software on the system - the first task listed below.

Updating The System

If the user is connected to the Internet and if there are any updates available, a notification will appear after a while in the launcher as shown in the figure below (as indicated by an arrow in the figure).


If cursor is moved onto the item on the launcher, the tooltip will read "Software Updater".


Click on the software updater launcher and the following window will pop up.


Then click on the "Install Now" button and the updating process will start and the user will then be prompted to enter the password for authentication.



Enter the password and then click on the "Authenticate" button. The update process will start downloading all the updates from the server (as shown in the figure below) and then install them. Wait for the update to complete.


Once completed, the software updater will automatically display a notice that the system is up to date if a system restart is not required. If a restart is required, the window shown below will appear - click on the "Restart Now..." button to restart the system. Log in again and the user will be at the Unity desktop once more.



Disabling The Amazon Search

Canonical has done a lot to improve the Ubuntu desktop. However, the author feels that there are 3 major 'improvement' that will not be missed if they were removed or addressed. One of the 'improvement' is that Canonical has integrated Amazon (the American based international online commerce company) search result into the Unity dash - the overlay that allows the user to search quickly for information both locally (applications, files, bookmarks, etc.) and remotely and displays previews of results. The dash is opened by clicking on the first (topmost) item in the launcher and then the item to search for is typed into the search box.


Whenever you search for an application or file on your computer in the dash, your search is sent to Canonical's servers. They forward your request to Amazon and displays you the Amazon search results. If you click an Amazon link in order to buy anything, Canonical gets a commission.

A majority of Ubuntu users (including the author) does not like this feature and almost the first thing they do is to disable it. The easiest way is to use the "System Settings" window by clicking the gear icon in the launcher. The system settings will open as shown.


Click the "Security & Privacy" icon, then click the "Search" tab, and toggle the "Include online search results" option to "Off" (see figures below).




Note that using this procedure will also disable all other online search results in the dash. To remove the "Amazon" icon from the launcher, just right-click on it and select "Unlock from Launcher" and it is gone - RIP Amazon Search.


Tuning The System

While the "System Settings" window is open, now would be a good time to set up the system to your liking. The user should still be in the "Security & Privacy" part of the system settings (if the user have not exited system settings). Click on the "All Settings" tab to go back to the system settings main window.

From this window, it is possible to change the way the desktop looks, set up the various pieces of hardware to work with the system, set up backup for the system, etc. There are 3 main categories - Personal, Hardware and System - the user can explore each possible setting by clicking on the icon for the item. For example, click on "Details" to see details like default applications, etc (see figure below).


Using the author's desktop as an example, the following tasks were carried out:
  1. Using "Appearance", the wallpaper was changed from the standard purple coloured wallpaper to 'Beach' - a more pleasing (to the author) wallpaper



    Click on the "Behaviour" tab and a window similar to the one shown below will appear. From here the user can change another 'annoying' feature of Ubuntu (2 of 3) - click "In the window's title bar" under "Show the menus for a window" item. Menus for the focused window won't appear on the top bar (the default behaviour) if this is enabled. Instead, they’ll appear in the window’s title bar. This will make Ubuntu seem more familiar if the user are used to Windows and traditional Linux desktops. Be aware that this menu will only appear when the user hover the mouse over the title bar. This menu will be hidden most of the time.


  2. Using "Sound", the sound hardware for the system was set up. Items like volume, input, etc was set and tested.


    On the author's system, the output was set to the 'Analog Output', the built-in audio device (see figure above). The 'Input' was set to the Webcam C250 (a Logitec device) as shown in the figure below.


    The 'Sound Effects' and 'Applications' was set at their default values. Also set as shown was the 'Output volume' level. Note that the output setting can be tested by clicking on the 'Test Sound' button.

  3. Using "Language Support", the language selected was corretly set up. The screen shots may differ from those shown below if the user selected a different language during install.





  4. Using "Bluetooth", any Bluetooth devices can be 'paired' with an Ubuntu PC or notebook which have Bluetooth devices and services enabled. However, be aware that not all Bluetooth PC 'dongle' will work with Ubuntu. The author had several 'dongle' in his possession, ranging from old ones (which looks like a USB thumb drive) to the latest and very tiny 'dongle'. After testing all the 'dongles', the author found out that only a few worked - and those were the newer models. So, if your 'dongle' does not work with Ubuntu, try another one.

    Before attempting to pair a Bluetooth device with Ubuntu PC, plug in the 'dongle' (notebooks usually comes with Bluetooth, so ignore this if you are using Ubuntu on a notebook). Then check the 'notification' area on the top right corner of the screen - you should see the Bluetooth icon there if your 'dongle' works with Ubuntu (see figure below).


    If the Bluetooth icon is clicked, you should see that Bluetooth services is enabled by default (see figure below).


    The user can now proceed to pair a Bluetooth device with Ubuntu. As an example, the author has a Samsung Galaxy Note 2 Android smartphone (model number GT-N7100 running Android version 4.4.2) which will be used as the Bluetooth device to pair with Ubuntu. Of course, the phone will need to have it's Bluetooth sevices enabled and this is easily done with the following steps:

    1. Touch "Settings"
    2. Then enable Bluetooth by touching the 'switch' to 'On'
    3. Then touch the 'Bluetooth' item and in the 'My device' screen, make sure that the GT-N7100 device is visible by enabling it - just touch the checkbox. While the smartphone is visible (a timeout timer will start on the smartphone), the following steps need to be performed on the Ubuntu PC or notebook.
    4. Click on the Bluetooth icon on the Ubuntu PC
    5. Select "Set Up New Device..."
    6. The 'Bluetooth New Device Setup' screen (shown below) will appear with the words 'Searching for devices...' on it. After a while (and if the visibilty of the smartphone has not timed out), the item "GT-N7100" will be listed as shown. Select the device by clicking on it and then the "Continue" button.


    7. The next screen (shown below) will prompt you to enter the indicated PIN number on the smartphone. At this time you will hear a 'beep' from the phone and you will be prompted on the phone to enter the PIN number indicated on the PC (or notebook) screen.


    8. Enter the PIN number on the smartphone, touch "OK" and the screen on Ubuntu will change to the one shown below - indicating success with the pairing (the PC or notebook name will also appear on the smartphone as one of the paired devices).


    The user can now easily exchange files between the phone and Ubuntu.

    By following the steps outlined above, the user can easily set up any Bluetooth enabled devices on Ubuntu.

    Just be aware that leaving the Bluetooth services enabled on the smartphone will drain the phone's battery faster - so remember to switch off Bluetooth after using it.

    To remove (or unpair) a Bluetooth device (the smartphone in this case) follow the steps below:

    1. On the smartphone, touch "Settings" and enable Bluetooth (if it is off), then touch the "Bluetooth" item
    2. On the screen that appears next, touch the gear icon to the right of the PC (or notebook) name, then touch "Unpair" (the PC or notebook name will be listed under "Available devices"). Exit from here
    3. On the PC (or notebook), click on the Bluetooth icon on the notification bar ans select "Bluetooth Settings..."
    4. On the screen that appears next, select the device by clicking on it (see figure below) followed by a click on the "-" (minus) button below. You will be prompted to confirm the removal (see figure below) - click "Remove" to remove the device



    5. The smartphone will be removed (unpaired) - close the settings window

    Any Bluetooth device can be easily removed by following the steps above - consult the device manuals if unsure of the unpairing procedure. Just remember that once a Bluetooth device is removed or unpaired, it need to be re-installed before it can be used again. Also remember that only paired devices are 'visible' to each other so there is no need to enable visibility on the devices.

  5. Using "Printers", the user can easily add printers to Ubuntu. Before using the "Printers" setting, make sure that the printer is connected to the Ubuntu PC or laptop and is powered up. Then click on the "Printers" item and you will see a screen similar to the one below.


    Click on "Add" and the screen as shown below will appear - if the printer is recognized, it will be listed as shown (an HP LaserJet Professional P1102 in this example). Click on that item and then on the "Forward" button.


    It will then start a search online for the correct driver for the printer and if found, the screen will change to the one similar to the one shown below. Click the "Apply" button and the printer will be installed.


    The next screen will prompt you to print a test page - do so and a "Submitted" window will appear (see below).



    Click "OK" and the "Printer Properties" window will appear (see below). You can now change any setting if desired - then click "OK".


    You will now be back at the "Printers" window (see below) but with the just installed printer listed.


    Note the green-colored checkmark - this denotes that the printer is the default printer so all print jobs will be routed to this printer. If you have more than one printer installed, the setting up of a default printer can be easily set up by using the printer properties.

Setting Up The Terminal

A terminal or console is useful for times when the user is required to execute commands on a line instead of using a GUI. Before using a terminal, however, it would be advisable to configure it to the user's taste. The author prefers the terminal to be of larger size and use a larger font. As mentioned previously, it will be up to the user to configure the terminal as desired - the procedure is the same.

First click on the dash and then type 'terminal' as shown into the search box. Then click on the 'Terminal' icon under 'Applications' - ignore 'UXTerm' and 'XTerm'.


A terminal will open up. Move the cursor to the title bar of the terminal window and the menu items for the terminal will appear as shown below.


Click on 'Edit' and 'Profiles' to open the profile window as shown below.


The 'Default' profile is already selected so click the 'Edit' button. You can now edit any items for the default profile (shown below) to suit your taste.


The author has chosen the Monospace 12pt font by removing the tick mark from the 'Use the system fixed width font'. The author also has increased the size of the terminal window to 110 columns and 34 rows. The final settings used by the author is as shown below.


Click 'Close' to close the settings window followed by another click on the 'Close' on the profile window. Notice that the changes made will not be reflected on the currently open terminal window. You need to close the terminal window and re-open it to see the changes but before we do it, we need to lock the terminal icon on the launcher to make it easier to launch a terminal. To do this, right-click on the terminal icon in the launcher, and the click on the 'Lock to Launcher' item. Then close the currently open terminal window. Click on the terminal icon on the launcher and the re-sized terminal window will open.


Installing Software From The Command Line

While the terminal is open, the following software will be installed using the 'apt-get' command on the command line. Type the following command as shown below:

  sudo apt-get install mc synaptic

You will be prompted to enter your password - do so and the command will execute and the screen will change to one similar to that shown below. Press the 'Enter' key to accept the default 'Y'. The various packages will downloaded and then installed.


The two packages installed are mc - a terminal based file management system and synaptic - an old-style software package management system. Note that a newer software package management system called 'Ubuntu Software Center' is installed by default and an icon is present for this in the launcher. The reason why the author chose to install this package is simply because he is more comfortable using this old-style software package management system.

If you recall from the figure shown above, there were old kernel files that can be removed from the system to free up disk space using the 'apt-get autoremove' command. Do so by typing in the following:

  sudo apt-get autoremove

The old kernel files will then be removed from the system. One last task before the terminal is closed and that is to bring back the old-style scroll bar back. If you notice, the new 'scrollbar' (in the form of a button), is normally hidden until you move the mouse pointer over the left side of a window. If the user is unconfortable with this (like the author), the old style scrollbar can be restored by executing the following command in the terminal.

  gsettings set com.canonical.desktop.interface scrollbar-mode normal

Note that the whole command should be on one line. After this command is executed, the familiar old style scrollbar should appear to the left of any window of appropriate size.

The terminal window can now be closed.


Installing Software From Ubuntu Software Center

As a last post-install task - that of installing the Dropbox software using Ubuntu's new Software Center. Note that the same task can be accomplished via the command line or the old style Synaptic Package Manager - the use of Ubuntu's Software Center is the new way to go. Follow the steps below for the installation:
  1. Click on the Ubuntu Software Center icon on the launcher

  2. Type 'dropbox' into the search box

  3. Click on the first item (Dropbox) in the list followed by a click  on the 'Install' button

  4. Enter your password to authenticate

  5. Wait for the Software Center to finished downloading and installing Dropbox (a rotating arrow will be shown along with a number 1 on the 'Progress' item in the top bar)

  6. To indicate the completed job, the 'Install' button will change to 'Remove'

  7. Close the Software Center and an 'Information available' window will be shown - since the Nautilus file manager is not open, this message can be ignored

  8. Click the 'Next' botton and the message will change to "Start Dropbox to finish installation' - click on the 'Close' button

  9. Click on the Dropbox icon in the launcher

  10. After a while, the Dropbox Setup window will appear. If you don't have a Dropbox account, click 'Next' and follow the on-screen instructions. If you already have an account (like the author), select 'I already have a Dropbox account' and click the 'Next' button

  11. Enter the correct email address and password information and then click the 'Next' button

  12. Select the setup type - the recommended one ('Typical') should suffice for most people

  13. You can now take the tour of Dropbox or you can skip it entirely by clicking on the 'Skip Tour' button

  14. Dropbox setup is now complete - click the 'Finish' button to exit setup and open the Dropbox folder

  15. If this is the first time you are using Dropbox, you will find that there very little contents in your Dropbox folder - however, if you are like the author (as shown below) and have lots of stuff in Dropbox, it will take time for Dropbox to sync with the cloud

  16. To make access to Dropbox easier within the Nautilus file manager, create a bookmark by clicking 'Bookmarks' and selecting 'Bookmark this Location' - Dropbox will now be found under the 'Bookmarks' section of the file manager



That's it - Dropbox is now installed on your Ubuntu system and you can now use it.

This concludes the basic post-install tasks of a freshly installed Ubuntu 14.04.1 system.


Summary

As a summary, the following steps are performed after installing Ubuntu 14.04.1:
  1. Update the system - reboot if necessary
  2. Disable Amazon Search using System Settings
  3. Tune the system using System Settings and fix menu display
  4. Set up the terminal and fix scrollbar
  5. Install other software as necessary
That's it - the Ubuntu 14.04.1 system is now ready for use. Enjoy!

Tuesday, April 22, 2014

Ubuntu 14.04 LTS And Dropbox

Ubuntu 14.04 LTS is finally here! One of the first thing that I normally do after installing or upgrading Ubuntu is to install Dropbox, a file hosting service that offers cloud storage. FYI, all my text files are stored on Dropbox.

The Dropbox client on Ubuntu 14.04 LTS is easily installed using one of 3 ways. This article will show you how.

Installing Dropbox on Ubuntu 14.04

Use the Ubuntu Software Center

  1. Open the center and search for 'dropbox'.
  2. Click on 'Install'.
  3. Enter your password to authenticate the install.
  4. Wait for the download and install to finish (the Install button will change to Remove).
  5. Close the Ubuntu Software Center. (A window may appear next asking you to restart Nautilus - do so by clicking on the 'Restart Nautilus' button, then click the 'Next' button.)
  6. In the window that appear next, you will be prompted to start Dropbox. Do so by clicking on the 'Start Dropbox'.
  7. Follow the on-screen instructions to register or login to a Dropbox account.
  8. When complete, close the 'Information available' window.
 Use a web browser
  1. Search for 'download dropbox for ubuntu' using Google or any other search engines.
  2. Click on the search result that say 'Install Dropbox on your Linux box'.
  3. Click on either the 64-bit or 32-bit versions (depending on your Ubuntu OS) of the file for Ubuntu (.deb).
  4. Click on 'Save File' and wait for the download to finish.
  5. Close the web browser.
  6. Open Nautilus file manager and go to the 'Downloads' folder.
  7. Double-click on the dropbox .deb file.
  8. Click on the 'Install' button on the Ubuntu Software Center window that appears next.
  9. Follow the same steps (3) to (8) in the 'Use the Ubuntu Software Center' section above.
Use the command line
  1. Open a terminal.
  2. Execute:
      sudo apt-get install nautilus-dropbox
  3. Enter your password if prompted and press the Enter key to confirm the install.
  4. Dropbox will be downloaded and installed - as suggested by the message in the terminal first quit Nautilus (if open) by executing:
      nautilus --quit
  5. Close the terminal.
  6. Click on the 'Search' icon in the Unity dock (the first icon on top) and type 'dropbox' - the Dropbox icon will appear.
  7. Click on the Dropbox icon.
  8. Follow the on-screen instructions to register or login to a Dropbox account.

Note that the Dropbox icon will appear in both the Unity dock and the notification bar on the top right hand corner. Use the one on the notification bar to open the Dropbox folder in Nautilus. The one on the Unity dock exist to restart Dropbox and re-enable the Dropbox notification icon if you accidentally closed it via the 'Quit Dropbox' item.

You can set a bookmark to the Dropbox folder in Nautilus by clicking on the 'Bookmarks' item in Nautilus's menu and then select 'Bookmark this Location'.

If you decide that Dropbox is not your 'thing' and you want to remove it, you can use either the Ubuntu Software Center or the command line. Remember to exit Dropbox first by clicking on notification bar on the top right hand corner and selecting 'Quit Dropbox'.

Using the Ubuntu Software Center, search for 'dropbox', select it and click on the 'Remove' button and then authenticate when prompted. Dropbox will then be removed.

To use a command line, start a terminal and type 'sudo apt-get remove nautilus-dropbox', authenticate and then press the Enter key when prompted. Dropbox will then be removed.

Sunday, January 26, 2014

Installing Ubuntu 12.04 on Compaq Presario B1900 Laptop

I have an old laptop - a Compaq Presario B1900 - and I was wondering what to do with it since I was reluctant to part with it. So I decided to turn it into a Linux laptop - specifically an Ubuntu 12.04 (Precise Pangolin) laptop.

I discovered very early on that there were issues with Ubuntu 12.04 running on this laptop - the biggest of which had to do with the wifi and the sound hardware - the standard drivers simply did not work.  After doing a bit of research on the internet, I finally solved the drivers issues. This how-to guide is aimed at those having the same laptop and wants to use Ubuntu 12.04 on it. Just follow the steps below:

  1. Make sure that internet access is available to the laptop before installing Ubuntu - DO NOT USE wireless as the Broadcom drivers will NOT be recognized by Ubuntu. Use a Ethernet LAN connection to the internet instead.
     
  2. Install Ubuntu 12.04.3 (the latest version) on the laptop as usual by following the on-screen prompts. Restart the laptop upon completion.
     
  3. Run Update Manager and apply the latest updates to the system. Restart if prompted to do so.
     
  4. Open a terminal and run the following commands to install the Broadcom wireless drivers:
     
      sudo apt-get remove --purge bcmwl-kernel-source
      sudo apt-get install b43-fwcutter firmware-b43-installer
      sudo modprobe b43
      sudo su -
      echo "b43" >> /etc/modules
      exit


    Close the terminal and test the wireless by first switching off wireless (fn-f2) wait for a second and then switch it back on - it should work now. Remove the Ethernet LAN connection and reboot - wait for a while then connect - laptop's internet connection is now purely wireless.
     
  5. To fix the audio, first edit:

    sudo nano /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf

    Search for all lines beginning with "required-any" and comment them out by placing a "#" at the start of the line. Save the edits and close the file. Then edit:

    sudo nano /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf

    As before, search for all lines beginning with "required-any" and comment them out by placing a "#" at the start of the line. Save the edits and close the file. Then reboot the system. You should see all audio devices under 'System Settings' -> 'Sound'.
     
  6. To enable MTP (Media Transfer Protocol) support so that an Android smart-phone can be connected to the laptop via a USB cable for file transfer, execute:

      sudo apt-get install mtp-tools mtpfs

    Then install full support for MTP devices by first opening a terminal and then add the following PPA to your system:

      sudo add-apt-repository ppa:langdalepl/gvfs-mtp
     sudo apt-get update


    Then, close the terminal, launch Update Manager and install the available updates. Once everything has been updated successfully, restart your computer, unlock your Android device, connect it via USB and it should show up in your file manager.
     
That's it - you now have a Compaq Presario B1900 laptop running Ubuntu 12.04 on it. Enjoy!

Wednesday, December 25, 2013

Starting Android Programming on Windows 7 (UPDATED)

This is an updated blog based upon an earlier blog on starting Android programming on a Windows 7 PC. It was done to reflect changes to the Java JDK, Android SDK and ADT, and the Eclipse IDE. Oracle Java has been updated to 1.70_45 while Google has created an Android ADT bundle which includes Eclipse, the ADT plugin and all other bits and pieces which are required for Android software development. This makes things easier for the developer since only 2 package types need be downloaded and installed - Oracle Java and the ADT Bundle. I also took this opportunity to include lots of screen-shots as well as revise the text of the blog.

Recently, I invested in an Android smartphone (albeit a cheap one) and wanted to write my own software for the smartphone. So I did some research via the Internet about Android software development. As usual, there were a lot of information available from the Internet, some good and some bad (as far as 'easy-to-read' and 'understandable' goes) - so I decided to write my own guide on how a beginner to Android software development can start on a Windows 7 PC. This blog covers Android software development on a 32-bit Windows 7 PC while the procedures for a 64-bit Windows 7 PC is very similar. I will also assume that the reader is familiar with software programming in general and Java in particular. No effort will be made to teach the reader how to program - so be forewarned.

Writing software for Android requires Java. So, the first thing to do is download and install the Oracle Java JDK.

  1. Open a web browser and go to here - Click on 'Download' under the JDK column - NOT the JRE column (see figure below).


         Select Java 7 JDK

    You will then brought to the download page where you first have to accept the license agreement (click on the 'Accept License Agreement) and then you have to select the correct file for your OS - in my case, it is 'jdk-7u45-windows-i586.exe' for the 32-bit Windows 7 32-bit OS. Note that that you can download and install the same 32-bit Java JDK on a 64-bit Windows 7 PC - which is highly recommended anyway.


         Download Java 7 JDK

    Click on 'Save File' when the dialog box pops up. This will take a while to finish downloading. When completed, and on the same download page, click on the demos and samples file (in my case it is jdk-7u45-windows-i586-demos.zip) to download it.


         Download Java 7 Samples & Demos

    When completed, go back to the last web page (use the browser's back key), scroll down the web page until you see Java SE 7 Documentation (see figure below) - then click on it.


         Select Java 7 Documentation

    Again you first have to accept the license agreement (click on the 'Accept License Agreement) and then click on the 'jdk-7u45-apidocs.zip' file.


         Download Java 7 Documentation

    Save this file to the same folder as the JDK you have downloaded. Again, this will take a while to finish downloading.

    Go to the folder where the downloaded Java JDK file 'jdk-7u45-windows-i586.exe' resides and double-click on it. Click 'Yes' when UAC pops up - then 'Next', 'Next', and again 'Next'. When you see the 'Successfully Installed Java SE Development Kit 7 Update 45' window, click 'Close'.

    To install the Java 7 API documents, first unzip the file (jdk-7u45-apidocs.zip in my case) to a temporary folder and then move the 'docs' folder from the temporary folder to the Java JDK folder (C:\Program Files\Java\jdk1.7.0_45 in my case). If UAC pops up, click on the 'Continue' button.

    To install the Java demo and sample files, first unzip the file (jdk-7u45-windows-i586-demos.zip in my case) to a temporary folder. This will create a folder named 'jdk1.7.0_45' in which 2 sub-folders, 'demo' and 'sample' are found. Move these 2 sub-folders to the Java JDK folder (C:\Program Files\Java\jdk1.7.0_45 in my case). If UAC pops up, click on the 'Continue' button. You now have Java JDK 7 installed.
     
  2. Windows 7 does not set the environment variable JAVA_HOME. If you plan to use a text editor and/or the command line (or with Eclipse) to develop Java programs, you have to do this manually if you want to develop Java software. Failure to do this may cause error(s) when developing and testing Java software. Also, the path variable need to include the 'bin' subdirectory of the Java JDK if the 'javac' compiler is used to compile Java software from the command line. To set these variables, follow these steps:

    1. Right-click on the 'Computer' icon on your desktop (if present) or click on the 'Start' button then right-click and select 'Properties'.
    2. Click on 'Advanced system settings' located on the left-hand column.
    3. Click on the 'Environment Variables' button.
    4. Under the System variables part, click 'New'.
    5. Enter the Variable name as JAVA_HOME.
    6. Enter the Variable value as the installation path for the Java JDK (C:\Program Files\Java\jdk1.7.0_45 in my case).
    7. Click 'OK' to set the new JAVA_HOME variable.
    8. Under the System variables part, click on the 'Path' variable already there (you may have to scroll down a bit) and the click on the 'Edit...' button.
    9. Press the 'End' key to place the cursor at the end of the line and enter the 'bin' path (preceeded by a semi-colon ';') - in my case is ';C:\Program Files\Java\jdk1.7.0_45\bin'. Press 'OK', 'OK' followed by another 'OK'.
    10. Reboot Windows 7 in order for the PC to recognize the new system variables.

    To test whether the environment variable JAVA_HOME has been set correctly, open a command window and type:

      echo %JAVA_HOME%

    If the output shows the correct path (C:\Program Files\Java\jdk1.7.0_45 in my case) then JAVA_HOME has been set correctly. If not, check that you have followed the steps (1) to (10) above correctly.

    To check whether the path has been set correctly, type:

      javac -version

    If you see 'javac 1.7.0_45' as the output line, the the path has been set correctly.  If not, check that you have followed the steps (a) to (j) above correctly. Once you have corrected the problem, and as another test that Java is working correctly, type:

      java -version

    If you see "java version "1.7.0_45"" in one of the output lines, then you have installed Java correctly.
     
  3. Writing software for Android also requires the official Android SDK, and the Eclipse IDE. Google has created a ADT Bundle to make things easier for the developer as this is the only package (it includes the essential Android SDK components and a version of the Eclipse IDE with built-in Android Developer Tools) that has to be downloaded. It contains everything a developer needs to begin developing Android applications. Open a web browser and go to here. Click on the 'Download the SDK' button on this page (see below).


         Download ADT Bundle

    On the next page, agree to the Terms and Conditions, select the correct version (32 or 64 bit), and then click on the 'Download the SDK ADT Bundle for Windows' (see below) button to start downloading.


         Select Download ADT Bundle

    Wait for the download to finish then unzip the file to the C:\Users\*username* folder (replace *username* with your own login name). Once completed, you will find a new folder labelled 'adt-bundle-windows-x86-20131030' under C:\Users\*username*.

    That's it! The IDE is already loaded with the Android Developer Tools plugin and the SDK is ready to go.
     
  4. The Eclipse executable is found in the C:\Users\*username*\adt-bundle-windows-x86-20131030\eclipse (replace *username* with your own login name) directory. It is suggested that a shortcut to the executable be made on the desktop so that Eclipse can easily started.

    Double click on the Eclipse icon to start it - if this is the first time that Eclipse is started, a default workspace needs to be specified in the windows that pops up (see below).


         Eclipse Workspace

    Put it anywhere you like - in my case I placed it under C:\Users\*username*\Projects\Android (where *username* is my own login name) and I use this as my default by selecting 'Use this as the default and do not ask again'. Click 'OK' - if this is the first time that Eclipse is started, a 'Contribute Usage Statistics' window will be displayed as shown below. Select either 'Yes' or 'No' and then click on the 'Finish' button.


         Eclipse Contribute Usage Statistics

    The Eclipse 'Welcome Screen' will be displayed as shown below. Read this and follow the links if you wish. Remember that this window can be re-displayed at any time later by selecting 'Help' and then 'Android IDE' from the menu.


         Eclipse Welcome Screen 
     
    Close the welcome screen by closing the Android IDE tab and the main Eclipse workspace will be displayed (see below).


         Eclipse Workspace
     
  5. Click on the 'Window' item on the Eclipse menu, and then select 'Android SDK Manager'. After a while, the Android SDK Manager window (shown below) will appear.


         SDK Manager Window

    Notice that both the Android SDK Tools and Android SDK Platform-tools have already been installed along with some of the files for Android SDK (API 19). If there are updates to any of the items already installed, these will be indicated as shown in the figure above. Notice the button at the lower right hand corner that says 'Install 5 packages...' - click on this button and a window (as shown in the figure below) will pop-up asking to to confirm the packages to be installed along with the acceptance of the license. Click on the 'Accept License' and then the 'Install' button. Then wait for the updated items to be downloaded and installed.


         Package Install

    When completed, you should see a screen similiar to the one below. At this point, you can select other extra packages to install. Note that you can start developing Android software for Android version 4.4 (KitKat) without installing anything else. However, if your actual Android device is not version 4.4 but a previous version, for example version 4.1.1 (JellyBean), you can download files for that version but be aware that version 4.4 (KitKat) is supposed to be backward compatible to lower versions (what this mean is that software developed using version 4.4 SDK will work on previous versions of Android).


         Updated Packages Installed

    I do encourage that the samples and documentation for Android 4.4 be downloaded and installed. To do this, place check-marks on the 'Documentation for Android SDK' and the 'Samples for SDK' files. Then click on the 'Install 2 packages...' button. The Choose Packages to Install window will pop up (see below) - select 'Accept License' followed by the Install button. The items will then start downloading - progress of the download and install process will be shown on the SDK Manager window.


         Choose Packages Window

    Once the process is completed, the SDK Manager will show something like the one shown in the figure below. Then close the SDK Manager.


         Packages Installed
     
  6. You can now set up one or more Android virtual devices (AVD) which correspond to your actual Android device(s). By doing this, you can test the developed software to see whether they work or not on the device. To do this, first click on the Window item in the menu, and then select Android Virtual Device Manager. After a while, the AVD Manager window (shown below) will appear.


         AVD Manager Window

    If this is the first time you are using the Android AVD Manager, there will be no virtual devices and the list of available AVD's will be empty. To create a new virtual device, click the 'New...' button. A window will appear in which you need specify what type of device you are going to create (see figure).


         New AVD Window

    First enter the AVD Name of the device - for example 'MyKitKat' - any name will do, as long as you remember what type of device it represent (an Android 4.4.2 KitKat device in this case).

    Next you need to specify a Device to emulate - in my case, I decided to use a 5.1" WVGA smartphone as this closely resemble the actual phone that I have in my possession. You, on the other hand, may have different Android hardware - choose one closest to the specification of your hardware.

    Next you need to specify the Target - i.e., the version of Android targeted - click on the right-hand downward arrow and click on a suitable one from the list. Note that this list will only contain all the versions that you have previously installed using the Android SDK Manager. In my example, there is only one - the Android 4.4.2 - API Level 19. The CPU/ABI will be automatically entered - in my case 'ARM (armeabi-v7a)'.

    Leave the Keyboard and Skin at the default. Then select a Back Camera to use by clicking on the right-hand downward arrow and click on a suitable one from the list. Since I have a webcam on my PC. I selected 'Webcam0'. Note that this item will not be listed if you do not have a webcam - if that is so, select 'Emulated' instead.

    Leave the RAM and VM Heap and Internal Storage values at the default values. You can, however, change to suit your preference.

    You can now specify the size of the SD card to emulate (in KiB, MiB, or GiB) - in my case I entered 200 MiB. Under Emulation Options, enable 'Use Host GPU'. Leave the rest of the fields at the defaults. The final screen will look something like the one shown below.


         New AVD Settings

    Click on the 'OK' button - the newly created virtual device will now appear in the AVD list (see below).


         New AVD Created
     
  7. To test whether the newly created virtual device works, select the device and click on the 'Start' button - the AVD Launch Options window will appear (see below).


         AVD Launch Options Window

    You are free to set any of the launch options here. For this article, we will leave the options at their defaults and click 'Launch' on the launch option window - the AVD will then start (see below).


         AVD Launching

    After a while, the KitKat Android virtual device will appear on the desktop - initially this will be blank (as shown below). This denotes that it is still loading - be patient.


         AVD Initial Screen

    The KitKat Android virtual device will change to one with a flashing 'Android' figure (see below). Wait for the flashing to stop - which may take some time to finish.


         AVD Loading

    Once the AVD has finished loading, you will be greeted with a screen similiar to the one below (a help screen for those curious) - just admire it and then click on the OK button.


         Android Initial Screen

    The home screen for Android will then appear as shown below.


         Android Home Screen

    Test the AVD on/off button by clicking on the power button (rightmost button on the top row). If this works, then the AVD's screen will go blank, signifying a power off condition (see below).


         AVD Powered Off

    Click on the power button again. The login screen (see below) will appear if everything works.


         AVD Login Screen

    Just like a real Android device, you have to slide the padlock to the right to unlock the device - do so and the home screen will reappear.


         AVD Slide To Unlock 
     
    Now click on the Apps button on the home screen (middle button on the bottom row of the home screen). Another help screen similar to the one shown below will the appear. Click on OK to dismiss this screen.


         AVD Apps Help

    The screen will now display all the apps (application software) on the AVD. You can play around with the apps later - for now let's test the Menu, Back and Search buttons.


         AVD Apps Screen

    First click on the Menu button - the screen will look like the one shown below with 2 menu items appearing from below the screen. As usual the items and number of items will change depending on the screen being viewed. Click Menu again to dismiss the menu.


         AVD Menus

    Now click on the Search key (the rightmost button which looks like a magnifying glass) and after a short delay (depending on your internet connection) the screen will look like the one below.


         AVD Search Screen

    Now click on the Back button (the one to the left of the Search button) and the home screen will re-appear. Click on the Apps button again and the apps screen will re-appear. Then click on Home button (the leftmost button which looks like a house) and the home screen should re-appear.

    Once you have tested all the buttons, you can now play with the AVD. Just remember that this is a virtual machine emulating an ARM CPU based device on an x86 PC. If you expect the virtual device to be fast, then you need to lower your expectation - try it out and see what I mean. It does, however, serves as a test bed for the applications that will be developed later. Close the AVD when done and then close the AVD Manager.

    Now that you have downloaded, installed and configured all the components for developing software on the Android platform, you can start off programming with the obligatory 'Hello World' program.
     
  8. Start Eclipse and then click on the New button found in the toolbar. In the New project window that appears next (see figure below), expand the 'Android' item by clicking on the arrow to the left of the name and selecting 'Android Application Project'. Then click Next.


         Android Application Project Selected

    Fill in the form that appears (see below) with the data shown. Note that after entering the Application Name 'My First App', the Project Name and Package Name is automatically filled in - do not change this. The 'Minimum Required SDK', 'Compile With' and 'Theme' has also been filled in with the correct data - in my case, I have only to change the Target SDK to 'API 19: Android 4.4.2'). Then click Next.


         New Android App Data

    Click Next and when the 'Configure Project' screen (see below) appears, leave everything here at their defaults.


         Configure Project

    Click Next and the 'Configure Launcher Icon' screen (see below) appears. Do not change anything here.


         Configure Launcher Icon

    Click Next and the 'Create Activity' screen (see below) appears. Again, do not change anything here.


         Create Activity

    Click Finish when the 'New Blank Activity' screen (see below) appears.


         New Blank Activity

    The main Eclipse workbench will reappear after a while (see figure below) - your first Android project has now been set up with some default files.


         Workbench With First Project

    Although it is not evident from the figure above, note that the project that was just created includes a default "Hello World" source file that allows you to immediately run the application without having to enter any lines into your project. The expected output from this project are the words "Hello world!" displayed on the device's screen. You can view the expected output by clicking on the 'activity_main' tab on the Eclipse IDE.
     
  9. Now we will test out the application on the AVD you have previously created. First, make sure that you do not have any Android device plugged into your PC (we will test it on an actual Android device later). Then click on the Run As... button (the green one with the white right-pointing arrow) in the toolbar. A Run As window will appear (see below) - select Android Application and click OK.


         Run As Window

    The program will run and the AVD login window will appear (see below) - slide to unlock and, after a while, the output of your first Android application will appear in the AVD (see below). If this the first time you are running Eclipse, you may also get an Auto Monitor Logcat window popping up as shown below. Click OK if it does.


         AVD Login Window


         MyFirstApp Output


         Auto Monitor Logcat Window

    If you press the Home button and then the Apps button, you can see that your My First App will also be listed in the available applications (see below).


         My First App Listed 
     
    Congratulations! You have just successfully tested MyFirstApp on the AVD. Close the AVD once you have finished admiring your work. DO NOT CLOSE ECLIPSE YET! We will now test out the same app on a real Android device - which I assume you already have one.

    Before you do any else, I suggest that you visit Google's Android Developer web site here (http://developer.android.com/sdk/index.html), and then click on 'Workflow' and then 'Using Hardware Devices'. Acquaint yourself with the contents that appear - it gives clear instructions on how to setup and connect a device for testing during software development.

    Note that most Android devices manufacturers have instructions on how to connect the devices to a Windows 7 computer via a USB port. I suggest that you peruse their instructions first before trying to connect the devices to the computer. In some extreme cases, the USB drivers are part of a software package (e.g., the Samsung Kies) and is not separate - the whole package has to be installed before the USB connection works correctly.
     
  10. Install the necessary Windows 7 USB drivers before trying to connect the Android device to the computer. Either follow the device manufacturer's instructions (first choice) or follow the instructions here http://developer.android.com/tools/extras/oem-usb.html if you have any Google devices.

    Note 1: If you have a Nexus device that is not listed, try the Nexus (generic) driver first.

    Note 2: If you cannot find the C:\Users\*username*\adt-bundle-windows-x86-20131030\sdk\extras\google\usb_driver\ directory, then the Google USB Driver package has not been installed into the SDK. Use the SDK Manager (Eclipse >> Window >> Android SDK Manager) to mark and install the Google USB Driver package.
     
  11. Make sure that USB debugging is enabled on your device - the settings can normally be found at Settings >> Developer options but may vary from device to device, but it is always located in Settings.

    Connect your Android device to the computer via a USB cable. You may get one or more messages about the drivers being installed and the installation has been successful. If the instllation failed, do not go any further until you have resolved this - the USB driver MUST be installed in order for you to test developed applications on your device.

    Open the Windows Explorer and navigate to C:\Users\*username*\adt-bundle-windows-x86-20131030\sdk\platform-tools\ directory and Shift-right-click on it and select 'Open command window here'. Then execute the following command in the window:

      adb devices

    If your Android device has been connected correctly, you should see something like this (the numbers to the left may be different from that shown):

      List of devices attached
      0123456789ABCDEFG     device


    Close the command window.
     
  12. Click on the Run button on Eclipse and a Device Chooser window (shown below) will pop up. Select the device and click OK.


         Device Chooser Window
    After a brief period, the application will run and the same output as before will appear on the device (see below). If you select Apps on your device, MyFirstApp will also appear in the Applications list of the device.


         Hello World on Device

    Double Congratulations! You have just successfully tested MyFirstApp on the AVD as well on an actual Android device.
In this blog, a lot of features on Java, Android SDK and Eclipse were not explained. If this is the first time you are trying all of the said tools, then you need spend some time to familiarize yourself with them. Documentation on all the tools are available from the Internet, so look for them and read, read, read ... and then try out the tools. Don't be afraid of making mistakes ... it's the only way to learn. Good luck!