Java Friends/Android
안드로이드 네트워크 연결해 CRUD (입력, 수정, 추가, 삭제) 실습
coding-restaurant
2019. 8. 21. 14:09
728x90
728x90
1. 안드로이드 CRUD (입력, 수정, 추가, 삭제) 파일구성
2. 코드구성
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="새로고침"
android:id="@+id/btnRefresh"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="추가"
android:id="@+id/btn_add"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="추가"
android:id="@+id/listView"/>
</LinearLayout>
MainActivity.java
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="새로고침"
android:id="@+id/btnRefresh"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="추가"
android:id="@+id/btn_add"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="추가"
android:id="@+id/listView"/>
</LinearLayout>
728x90
728x90