Previous  Table of Contents  Next  

  Android Tools - Lightweight IDE for Android  
     
 

GETTING STARTED

Create, Build, Install and Run Hello Android Test Application

Note: In the steps below, you select the Basic tab in the Android Tools window then left and right click the boxes. If you so desire, you could also select the Advanced tab then left and right click the boxes and nodes there.
  1. Start Android Device Emulator:
    1. Click the Basic tab (default) in the Android Tools window.
    2. Click the Android Virtual Device box in the Basic tab then click MyAVD1 (default) in the popup list.
    3. Right click the Android Virtual Device box then click Emulator in the popup menu.
    4. Wait until Android appears in the top right corner of the Android phone in the MyAVD1 window (this takes several minutes).
    5. Drag the Unlock icon in the Android phone to the right to unlock the Android phone in the MyAVD1 window.
    6. Wait until the Launcher icon appears at the bottom of the Android phone.
    7. Click the Launcher icon.
    8. Wait until the application icons appear.
    9. Scroll to and click the Settings icon.
    10. Scroll to and click Languange & keyboard.
    11. Click the checked Japanese settings to deselect them.
    12. Click the Back key above the keyboard two times.
    13. Wait until the application icons appear in the Android phone.
    14. Right click the Android Device box in the Android Tools window then click List in the popup menu.
    15. Wait until emulator-5554 appears in the List Android Devices window.
    16. Click X in the top right corner of List Android Devices window.
    17. Click the Android Device box in the Android Tools window then click emulator-5554 in the popup list.

  2. Create Hello Android Application:
    1. Click the Project Directory box in the Android Tools window then click blank in the popup list.
    2. Right click the Project Directory box then click Create in the popup menu.
    3. Type HelloAndroid (default) in the Input dialog then click OK.
    4. Type com.android.helloandroid (default) in the Input dialog then click OK.
    5. Click Yes in the Confirm dialog.
    6. Wait until the create completes in the Create Android Project window.
    7. Click X in top right corner of the Create Android Project window.
    8. Verify that HelloAndroidTest appears in the Project Directory box in the Android Tools window.

  3. Build Hello Android Application:
    1. Right click the Project Directory box in the Android Tools window then click Build | debug in the popup list.
    2. Wait until Build Successful appears in the Build Ant Target window.
    3. Click X in the top right corner of the Build Ant Target window.

  4. Install Hello Android Application in Android Device Emulator:
    1. Right the Project Directory box then click Install | debug in the popup menu.
    2. Wait until the install completes in the Install Android Application window.
    3. Click X in top right corner of the Install Android Application window.
    4. Verify that the HelloAndroid icon appears in the application icons in the Android phone in the MyAVD1 window.

  5. Create Hello Android Test Application:
    1. Right click in the Project Directory box then click Create | Test in the popup menu.
    2. Click Yes in the Confirm dialog.
    3. Wait until the create completes in the Create Android Test window.
    4. Click X in top right corner of the Create Android Test window.
    5. Verify that HelloAndroidTest appears in the Project Directory box in the Android Tools window.

  6. Build Hello Android Test Application:
    1. Right click the Project Directory box then click Build | debug in the popup list.
    2. Wait until Build Successful appears in the Build Ant Target window.
    3. Click X in the top right corner of the Build Ant Target window.

  7. Install Hello Android Test Application in Android Device Emulator:
    1. Right click the Project Directory box then click Install | debug in the popup menu.
    2. Wait until Success appears in the Install Android Application window.
    3. Click X in the top right corner of the Install Android Application window.
    4. Verify that the HelloAndroid icon doesn't appear in the application icons in the Android phone in the MyAVD1 window.

  8. Run Hello Android Test Application in Android Device Emulator:
    1. Right click the Project Directory box then click Run in the popup menu.
    2. Verify that the HelloAndroid application doesn't run in the Android phone in the MyAVD1 window.
    3. Wait until OK (0 tests) appears in the Run Android Test window.
    4. Click X in the top right corner of the Run Android Test window.

  9. Edit Hello Android Application Main and Strings XML Files:
    1. Click the Project Directory box in the Android Tools window then click HelloAndroid in the popup list.
    2. Click the Layout Directory box then click layout (default) in the popup list.
    3. Click the Layout File box then click main.xml (default) in the popup list.
    4. Right click the Layout File box then click Edit in the popup list.
    5. Wait until main.xml appears in the Edit window appears.
    6. Copy and paste the following variable after <TextView in the Edit window:
      android:id="@+id/textView"
    7. Copy and paste the following text over "Hello World, HelloAndroid" in the Edit window:
      "@string/string"
    8. Click Save in the Edit window.
    9. Click the Value Directory box then click values (default) in the popup list.
    10. Click the Value File box then click strings.xml (default) in the popup list.
    11. Right click the Value File box then click Edit in the popup list.
    12. Wait until strings.xml appears in the Edit window appears.
    13. Copy and paste the following variable after <string in the Edit window:
      <string name="string">Hello, Android!</string>
    14. Click Save in the Edit window.

  10. Build Hello Android Application:
    1. Right click the Project Directory box then click Build | clean in the popup list.
    2. Wait until Build Successful appears in the Build Ant Target window.
    3. Click X in the top right corner of the Build Ant Target window.
    4. Right click the Project Directory box in the Android Tools window then click Build | debug in the popup list.
    5. Wait until Build Successful appears in the Build Ant Target window.
    6. Click X in the top right corner of the Build Ant Target window.

  11. Install Hello Android Application in Android Device Emulator:
    1. Right click the Project Directory box then click Install | debug in the popup menu.
    2. Wait until the install completes in the Install Android Application window.
    3. Click X in top right corner of the Install Android Application window.
    4. Verify that the HelloAndroid icon appears in the application icons in the Android phone in the MyAVD1 window.

  12. Edit Hello Android Test Application Hello Android Test Java File:
    1. Click the Source Directory box then click android in the popup list.
    2. Click the Source Directory box then click helloandroid in the popup list.
    3. Click the Source File box then click HelloAndroidTest.java (default) in the popup list.
    4. Right click the Source File box then click Edit in the popup list.
    5. Wait until HelloAndroidTest.java appears in the Edit window appears.
    6. Copy and paste the following imports (2) after the import in the Edit window:
      import android.widget.TextView;
      import com.android.helloandroid.HelloAndroid;
    7. Copy and paste the following variables (3) before the HelloAndroidTest constructor in the Edit window:
      private HelloAndroid mActivity;
      private TextView mTextView;
      private String mString;
    8. Copy and paste the following methods (3) after the HelloAndroidTest constructor in the Edit window:
      @Override protected void setUp() throws Exception {super.setUp(); mActivity = getActivity(); mTextView = (TextView) mActivity.findViewById(com.android.helloandroid.R.id.textView); mString = mActivity.getString(com.android.helloandroid.R.string.string);}
      public void testTextView() {assertNotNull(mTextView);}
      public void testString() {assertEquals(mString, (String) mTextView.getText());}
    9. Click Save in the Edit window.

  13. Build Hello Android Test Application:
    1. Right click the Project Directory box then click Build | clean in the popup list.
    2. Wait until Build Successful appears in the Build Ant Target window.
    3. Click X in the top right corner of the Build Ant Target window.
    4. Right click the Project Directory box then click Build | debug in the popup list.
    5. Wait until Build Successful appears in the Build Ant Target window.
    6. Click X in the top right corner of the Build Ant Target window.

  14. Install Hello Android Test Application in Android Device Emulator:
    1. Right click the Project Directory box then click Install | debug in the popup menu.
    2. Wait until Success appears in the Install Android Application window.
    3. Click X in the top right corner of the Install Android Application window.
    4. Verify that the HelloAndroid icon doesn't appear in the application icons in the Android phone in the MyAVD1 window.

  15. Run Hello Android Test Application in Android Device Emulator:
    1. Right click the Project Directory box then click Run in the popup menu.
    2. Verify that the HelloAndroid application runs in the Android phone in the MyAVD1 window.
    3. Wait until OK (2 tests) appears in the Run Android Test window.
    4. Click X in the top right corner of the Run Android Test window.

  16. Uninstall Hello Android Test Application in Android Device Emulator:
    1. Right click the Project Directory box then click Uninstall in the popup menu.
    2. Wait until Success appears in the Uninstall Android Application window.
    3. Click X in the top right corner of the Uninstall Android Application window.

  17. Uninstall Hello Android Application in Android Device Emulator:
    1. Click the Project Directory box in the Android Tools window then click HelloAndroid in the popup menu.
    2. Right click the Project Directory box then click Uninstall in the popup menu.
    3. Wait until Success appears in the Uninstall Android Application window.
    4. Click X in the top right corner of the Uninstall Android Application window.

  18. Stop Android Device Emulator:
    1. Click X in the top right corner of the MyAVD1 window.
 

 
Get Android Tools from Field Bird at SourceForge.net Previous  Table of Contents  Next