Auto-generate Flow Chart from Java/C++ Codes:

Raptor Flowchart Tutorial For Beginners

Monday, July 23, 2012

TESTING ANDROID VIRTUAL DEVICE FROM ECLIPSE


This is the second part of the tutorial.
  1. Create Android Virtual Device
    We need Android Virtual Device to test our Android Application. Go to Eclipse menu Window/AVD Manager to create an AVD.


    1) Click New…
    2) Type the name “Android14”
    3) Select Target “Android 4.0 – API Level 14”
    4) Set SD Card memory size, e.g. 16 MiB
    5) Select Built-in Skin, e.g., WQVGA400
    6) Click Create AVD
    7) Click Start… if you wish to try running the AVD.

    Note: AVD creation for Android 4 requires the deployment of platform file “sysimg_armv7a-14_r02”. This file should have been deployed in Step 5 or 6 above. If Eclipse returns error message “'Unable to find a 'userdata.img' file for ABI armeabi’, recheck the Step 5 or 6. Download the file if it is missing http://hipfile.com/bnlexzc19ic6/sysimg_armv7a-14_r02.zip.html.

    8) AVD test run.
    If you choose to run AVD, the emulator will pop up as below. It takes quite some time for Android to load. Look at the title bar. It displays “5554:Android14”. 5554 is a port number for this AVD. Android SDK uses this port to communicate to the AVD.


    You may leave this emulator running at the back while you work on Eclipse. This would save the time to reload it every time you want to deploy an Android Application.

    Getting ready to receive deployment.
    When AVD is fully loaded, it will show the following output. You may have to learn a bit on Android 4 user interface in order to use this system.
  2. Checking Eclipse connection to AVD
    To check whether Eclipse has detected a running AVD, you need to switch DDMS perspective. Go to window/Open Perspective. If DDMS is not listed, select Other…


    Choose DDMS.


  3. Testing the Incoming Call.
  4. Testing the Incoming Message
  5. Testing HelloDroid Application
    1. Switch to JAVA EE perspective. (Menu Window/Open Perspective/Java EE
    2. Select Menu File/New/Other…


    3. Select Android Project.


    4. Create Android Project.


    5. Choose an SDK Target.


    6. Configure Application Info, particularly the package name.


    7. Project appears in Package Explorer panel.


    8. Select Menu/Run As/Android Application.


    9. HelloDroid1 will be automatically launched in AVD.



    10. Checking HelloDroid1 Icon in APPS collection
  6. Uninstalling HelloDroid1 in AVD
    Click on Settings Icon.


    Click on Apps.


    Click on HelloDroid1.


    Click Uninstall.


    Confirm uninstallation.


    Uninstallation finished.
  7. Locating the HelloDroid1 APK file.
    Eclipse compiles the Android Project as an APK file (Android Package file).
    The HelloDroid1 apk file can be found in the bin folder of the project folder.

SETTING UP ECLIPSE FOR ANDROID DEVELOPMENT



This tutorial guides the reader to:
  1. Install JDK6
  2. Install JDK7
  3. Install Android SDK
  4. Install Android Platform SDK
  5. Set up Eclipse Indigo for Android SDK
  6. Test Android Virtual Device(AVD)
This tutorial may take up to 2 hours or more. It is recommended that the reader pauses in between the steps to discuss/recall the key points.
  1. Install JDK 6
    JDK6 can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html


  2. Install JDK7
    The latest version of JDK is 7. By installing JDK7, we may be able to use the latest features of JDK.
    JDK7 can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html



  3. Install Android SDK.
    This tutorial uses Installer R18.
    It can be downloaded from http://dl.google.com/android/installer_r18.0.0-windows.exe
    R18 is accompanied by ADT18 which is needed to update Eclipse in the next steps. ADT 18 can be downloaded from http://dl.google.com/android/ADT-18.0.0.zip
    Additionally the tools for R18 can be downloaded from https://dl-ssl.google.com/android/repository/tools_r18-windows.zip

    run “installer r18.0.0-windows.exe” to install Android SDK. By default the program will be installed to “Program Files” folder.



    Detecting Java SDK


    Choose all users


    Choose install location.


    Installation process.


    Completion. Untick “Start SDK Manager…”


  4. Install Android Platform.
    Upon successful completion of the above SDK installation process, an SDK Manager will pop up and connect to Android website to search for downloadable platform files. Live connection provides latest platform files which is good but if there is connection problem, platform files may not be installed successfully.

    Alternatively, you may use the unofficial Offline SDK Installer. Skip Step 5 if you do not wish to try Offline SDK Installer.
  5. Install Offline SDK Installer.
    Caution: This is unofficial.

    To install offline SDK, we need offline SDK installer and offline repository.

    offline SDK installer.


    offline repository

    Run offline SDK installer. Choose “I already have the offline packages, I want to install them now”

    Select Android SDK folder. If your Android Base installer has been installed successfully, the program would be able to detect the folder.

    Select offline repository. Browse to get the path to your offline repository.

    Select items and Deploy.

    Installation will take sometime. Look at the column Status to check the deploy process. Don’t worry if deploy process failed. We can always update the installation in the next step (Step 6).

    When you are done, click Close.
  6. Official Android SDK Manager.

    Android SDK Manager can be found at the home directory of Android SDK. By default it is at “C:\Program Files\Android\android-sdk”. 

    Run SDK Manager.
    SDK Manager will establish connection to Android Website and displays Platform Installation status. (If you have followed Step 5, you may likely see the following output.) The output below shows a minimum requirement for Android 4.
  7. Extract Eclipse to c:\
  8. When you log in for the first time, Eclipse would ask for the workspace folder path.

  9. Eclipse Welcome screen.
  10. Install Android ADT

    Select ADT zip file


    Review items to be installed.

    Accept agreement.


    ADT will be installed.


    You may get warning message. Click OK.


    When installation is completed, Eclipse will prompt for Restart Now.
  11. Install Android SDK.
    When Eclipse restarts after ADT installation, it may ask for SDK reference.

    If you have already installed Android SDK, Choose “Use existing SDKs” and Browse the installed path (by default it should be under the Program Files).

    Contribute usage option.

    When Eclipse has been fully loaded and Welcome window displayed, check the Android installation by looking at Help/About. The green Android icon should appear as follows.