Posts

Showing posts from August, 2011

Running Android Unit Test

Create a unit test based on AndroidTestCase then modify AndroidManifest to add:

<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:targetPackage="com.mypackagename.test"
android:name="android.test.InstrumentationTestRunner" />


Then select the class and run as "Android JUnit test"

Creating a new eclipse workspace and importing existing Android projects

First make sure you setup the Android SDK location in your Android Preferences

Typically I change the font settings in:
- Window | Preferences - General | Appereance | Color and Fonts - Basic | Text Font
And I choose "Lucida Console 9" on Windows

Regarding Java compiler warning, I choose to rely on the Override annotation to check override and interface implementations (!) spelling:

- Window | Preferences - Java | Compiler | Errors/Warnings | Annotations Missing @Override: Warning (check "include implementations of interface...")


You might get the following warnings:
android requires compiler compliance level 5For this select Android | Fix Project Properties
But since I use @Override for interface implementation, I make sur the workspace java level is set to 1.6 and that there is no project specific settings