Development
- [Android] TabWidget -tabStripEnabled 2011.01.13
- [Android] android:id 충돌 테스트 2011.01.13
- [Android] Layout XML에서 Android Default Resource사용하기 2011.01.12
- [Android] PreferenceActivity 사용하기. 2011.01.12
- [iOS] 기기별 App Icon List 정리 2011.01.12
- [iOS] Accessibility Inspector 사용하기 2011.01.11
- [iOS] Instruments 를 이용한 UI 테스트 자동화 - 입문 2011.01.10 2
- [Android] 부팅시에 코드 실행하기 2011.01.10
- [Android] could not find apk! 2011.01.05
- [Scrum] Sprint Demo에 관하여 2011.01.04
[Android] TabWidget -tabStripEnabled
[Android] android:id 충돌 테스트
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
>
</Button>
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
/>
</LinearLayout>
Button button = (Button) findViewById(R.id.button);
button.setText("First");
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
>
</Button>
<LinearLayout
android:id="@+id/linear"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
>
</Button>
</LinearLayout>
[Android] Layout XML에서 Android Default Resource사용하기
android:src="@android:drawable/ic_input_delete"
[Android] PreferenceActivity 사용하기.
Class 관계를 살펴보면 PreferenceActivity는 ListActivity를 상속받는다.
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/settings">
<CheckBoxPreference
android:key="alarm_in_silent_mode"
android:title="@string/alarm_in_silent_mode_title"
android:summary="@string/alarm_in_silent_mode_summary" />
<VolumePreference
android:title="@string/alarm_volume_title"
android:summary="@string/alarm_volume_summary"
android:dialogTitle="@string/alarm_volume_title"
android:persistent="false"
android:streamType="alarm" />
<ListPreference
android:key="snooze_duration"
android:title="@string/snooze_duration_title"
android:entries="@array/snooze_duration_entries"
android:entryValues="@array/snooze_duration_values"
android:defaultValue="10"
android:dialogTitle="@string/snooze_duration_title" />
<ListPreference
android:key="volume_button_setting"
android:title="@string/volume_button_setting_title"
android:dialogTitle="@string/volume_button_dialog_title"
android:entries="@array/volume_button_setting_entries"
android:entryValues="@array/volume_button_setting_values"
android:summary="@string/volume_button_setting_summary"
android:defaultValue="2" />
</PreferenceScreen>
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings); } @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (KEY_ALARM_IN_SILENT_MODE.equals(preference.getKey())) { CheckBoxPreference pref = (CheckBoxPreference) preference; int ringerModeStreamTypes = Settings.System.getInt( getContentResolver(), Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0); if (pref.isChecked()) { ringerModeStreamTypes &= ~ALARM_STREAM_TYPE_BIT; } else { ringerModeStreamTypes |= ALARM_STREAM_TYPE_BIT; } Settings.System.putInt(getContentResolver(), Settings.System.MODE_RINGER_STREAMS_AFFECTED, ringerModeStreamTypes); return true; } return super.onPreferenceTreeClick(preferenceScreen, preference); } public boolean onPreferenceChange(Preference pref, Object newValue) { final ListPreference listPref = (ListPreference) pref; final int idx = listPref.findIndexOfValue((String) newValue); listPref.setSummary(listPref.getEntries()[idx]); return true; }
[iOS] 기기별 App Icon List 정리
[iOS] Accessibility Inspector 사용하기
[iOS] Instruments 를 이용한 UI 테스트 자동화 - 입문
UIATarget.localTarget().frontMostApp().mainWindow().navigationBar().buttons()["Add"].tap();
app.navigationBar().withName("Add Recipe");
UIATarget.localTarget().frontMostApp().mainWindow().textFields()[0].setValue(name);
"Done" UIBarButtonItem 터치
target.delay(2);
app.navigationBar().rightButton().tap();
target.delay(2);
app.navigationBar().leftButton().tap();
app.navigationBar().withName("Recipes");
var cell = app.mainWindow().tableViews()[0].scrollToElementWithPredicate("name beginswith '"+name+"'");
if(cell.isValid() ) {
UIALogger.logPass(testName);
}
else {
UIALogger.logFail(testName);
}
TestScript작성법은 다루지 않았는데, 다음 포스트에 할 예정이다.
"UI Automation Reference" "Instruments User Guide" 을 참고 하면 어렵지 않게 이해할 수 있다.
4. UI Test
5. Test Result
스크립트 로그 창에, Log Pass/Fail이 표기 된다.
[Android] 부팅시에 코드 실행하기
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
@Override
public void onReceive(Context context, Intent intent) {
}
BroadcastReceiver Class를 상속받는 Receiver Class를 하나 만들고, onReceiver Method를구현해주면 됩니다. 참 쉽죠? ㅎㅎ
[Android] could not find apk!
[2009-11-02 16:28:51 - Android]adb is running normally.
[2009-11-02 16:28:51 - Android]Could not find ********.apk!