작성할 파일은 아래와 같고 프로젝트 목적은,
고객등록 액티비티에서 고객정보를 입력하고, "전송"버튼을 클릭하게 되면 입력한 정보를 출력하는 것입니다.
"이전" 버튼을 클릭하면 다시 입력 페이지로 돌아갑니다.
작성할 파일은 아래와 같고,
string.xml
main.xml
receive.xml
first.java
androidmainfest.xml
이번 페이지에서는 string과 main만 작성하고, 다음 페이지에서 나머지 부분을 작성하도록 하겠습니다.
이 글이 도움이 되신다면 추천한방 부탁드립니다^^
로그인 없이 누르시기만 하면 됩니다. 더 나은 정보로 보답할게요.
1. string.xml 리소스 생성
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">고객등록</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="name">성명</string>
<string name="sex">성별</string>
<string name="receive">수신여부</string>
<string name="birthday">생일</string>
<string name="interest">관심분야</string>
<string-array name="interest_array">
<item>経歴</item>
<item>科学</item>
<item>旅行</item>
<item>芸術</item>
<item>外国語</item>
<item>料理</item>
<item>Computer</item>
</string-array>
<string name="act_name_receive">顧客情報</string>
<string name="title_receive">入力した内容は次のようです。</string>
</resources>
2. main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<!-- 성명 폼 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="60sp"
android:layout_height="wrap_content"
android:text="@string/name"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/edit_name" />
</LinearLayout>
<!-- 성별 폼 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="60sp"
android:layout_height="wrap_content"
android:text="@string/sex" />
<RadioGroup
android:layout_width="60sp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/radiogroup_sex">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/radio_male"
android:text="男性" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/radio_female"
android:text="女性" />
</RadioGroup>
</LinearLayout>
<!-- 수신여부 폼 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="60sp"
android:layout_height="wrap_content"
android:text="@string/receive"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/checkbox_sms"
android:text="SMS"/>
</LinearLayout>
<!--관심분야 스피너 폼 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right" >
<TextView
android:layout_width="60sp"
android:layout_height="wrap_content"
android:text="@string/interest"/>
<!-- 스피너 설정 -->
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_interest" />
</LinearLayout>
<!-- 생일 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="60sp"
android:layout_height="wrap_content"
android:text="@string/birthday" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/edit_birthday" />
</LinearLayout>
<!-- 전송버튼 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_send"
android:text="전송" />
</LinearLayout>
'IT > Android' 카테고리의 다른 글
안드로이드 SQLite DB 활용한 고객등록과 조회 3-2 (0) | 2013.07.19 |
---|---|
안드로이드 SQLite DB 활용한 고객등록과 조회 3-1 (0) | 2013.07.18 |
WebView / 웹 문서 / 웹 뷰 (0) | 2013.07.16 |
Android 고객등록/정보전달 02 (0) | 2013.07.15 |
Android(안드로이드) 웹서버 (0) | 2013.07.15 |