2017-2018-2 20165301 實驗四《Java面向對象程序設計》實驗報告

2017-2018-2 20165301 實驗四《Java面向對象程序設計》實驗報告

1、Android Stuidio的安裝測試

實驗要求:
  • 參考《Java和Android開發學習指南(第二版)(EPUBIT,Java for Android 2nd)》第二十四章;html

  • 參考http://www.cnblogs.com/rocedu/p/6371315.html#SECANDROID,安裝 Android Stuidiojava

  • 完成Hello World, 要求修改res目錄中的內容,Hello World後要顯示本身的學號,本身學號先後一名同窗的學號,提交代碼運行截圖和碼雲Git連接,截圖沒有學號要扣分android

  • 學習Android Stuidio調試應用程序app

將佈局文件activity_main.xml中的android:text="Hello World!"改成android:text="Hello World20165315!"ide

實驗代碼
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World 20165301 20165302 20165339!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>
實驗截圖

2、Activity測試

實驗要求
  • 參考《Java和Android開發學習指南(第二版)(EPUBIT,Java for Android 2nd)》第二十五章:佈局

  • 構建項目,運行教材相關代碼學習

  • 建立 ThirdActivity,在ThirdActivity中顯示本身的學號,修改代碼讓MainActivity啓動ThirdActivity測試

  • 提交代碼運行截圖和碼雲Git連接,截圖要有學號水印,不然會扣分ui

實驗代碼
  • MainActivity
package cn.edu.besti.is.jhs.secondactivitydemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.on
        Create(savedInstanceState);
        Intent intent = new Intent(this,ThirdActivity.class);
        startActivity(intent);
    }
}
  • activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:layout_height="match_parent"
    tools:context="wyhy.activity.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="20165301 ctf"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>
  • activity_third.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="144dp"
        android:layout_height="26dp"
        android:text="20165301"
        tools:ignore="MissingConstraints"
        tools:layout_editor_absoluteX="109dp"
        tools:layout_editor_absoluteY="242dp" />


</android.support.constraint.ConstraintLayout>
實驗截圖

3、UI測試

實驗要求
  • 參考《Java和Android開發學習指南(第二版)(EPUBIT,Java for Android 2nd)》第二十六章:this

  • 構建項目,運行教材相關代碼

  • 修改代碼讓Toast消息中顯示本身的學號信息

  • 提交代碼運行截圖和碼雲Git連接,截圖要有學號水印,不然會扣分。

實驗截圖

4、佈局測試

實驗要求
  • 參考《Java和Android開發學習指南(第二版)(EPUBIT,Java for Android 2nd)》第二十七章:

  • 構建項目,運行教材相關代碼

  • 修改佈局讓P290頁的界面與教材不一樣

  • 提交代碼運行截圖和碼雲Git連接,截圖要有學號水印,不然會扣分

實驗截圖

5、事件處理測試

實驗要求
  • 參考《Java和Android開發學習指南(第二版)(EPUBIT,Java for Android 2nd)》第二十八章:

  • 構建項目,運行教材相關代碼

  • 提交代碼運行截圖和碼雲Git連接,截圖要有學號水印,不然會扣分

實驗截圖

實驗總結

步驟 耗時 百分比
需求分析 20 13.7%
設計 30 20.6%
代碼實現 50 34.4%
測試 30 20.6%
分析總結 15 10.3%
相關文章
相關標籤/搜索