??????????У??????????????Eclipse?д???Android JUnit?????????????????????????′??????????????????????

???????????

????????????????????????Android????????????????????Eclipse??Android SDK????????????????????????ν?Android Junit???????Android?????????????????????????β???Android?е?Activity????????????е????

?????????????????????http://code.google.com/p/simple-calc-unit-testing/??????

????????1 ??????????SimpleCalc???

??????????У????????д????????SimpleCalc???????????????н??????????????????????????????????????????????????????????????????????????????

??????

????????2 SimpleCalc?????????

?????????????????????????????????/res/layout/main.xml????????′??????:

????

????android:orientation="vertical" android:layout_width="fill_parent"

????android:layout_height="fill_parent">

????

????android:layout_height="wrap_content" android:text="@string/hello"

????android:gravity="center_horizontal" android:textSize="48px"

????android:padding="12px" />

????

????android:hint="@string/hint1" android:inputType="numberDecimal"

????android:layout_width="fill_parent" android:textSize="48px">

????

????android:hint="@string/hint2" android:inputType="numberDecimal"

????android:layout_width="fill_parent" android:textSize="48px">

????

????android:layout_width="wrap_content" android:layout_height="wrap_content"

????android:padding="12px" android:background="#ff0000">

????

????android:layout_width="wrap_content" android:layout_height="wrap_content"

????android:orientation="horizontal" android:background="#000000"

????android:padding="4px">

????

????android:layout_height="wrap_content" android:text="@string/resultLabel"

????android:textSize="48px" android:id="@+id/resultLabel">

????

????android:layout_height="wrap_content" android:id="@+id/result"

????android:textSize="48px" android:textStyle="bold"

????android:layout_marginLeft="16px">

 

????android:layout_height="wrap_content" android:layout_width="fill_parent">

 

?????????????????????????????????LinearLayout??????????????????????????С??????а????????????“Unit Testing Sample”??textview???????????????edittext????????FrameLayout????а????????????LinearLayout???????LinearLayout?????????????????textview????????????“Result”????????FrameLayout????????????????????LinearLayou???ó???????????