zoukankan      html  css  js  c++  java
  • 2017-2018-2 20165301 实验四《Java面向对象程序设计》实验报告

    2017-2018-2 20165301 实验四《Java面向对象程序设计》实验报告

    一、Android Stuidio的安装测试

    实验要求:
    • 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十四章;

    • 参考http://www.cnblogs.com/rocedu/p/6371315.html#SECANDROID,安装 Android Stuidio

    • 完成Hello World, 要求修改res目录中的内容,Hello World后要显示自己的学号,自己学号前后一名同学的学号,提交代码运行截图和码云Git链接,截图没有学号要扣分

    • 学习Android Stuidio调试应用程序

    将布局文件activity_main.xml中的android:text="Hello World!"改为android:text="Hello World20165315!"

    实验代码
    <?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>
    
    实验截图

    二、Activity测试

    实验要求
    • 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十五章:

    • 构建项目,运行教材相关代码

    • 创建 ThirdActivity,在ThirdActivity中显示自己的学号,修改代码让MainActivity启动ThirdActivity

    • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分

    实验代码
    • 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>
    
    实验截图

    三、UI测试

    实验要求
    • 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十六章:

    • 构建项目,运行教材相关代码

    • 修改代码让Toast消息中显示自己的学号信息

    • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分。

    实验截图

    四、布局测试

    实验要求
    • 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十七章:

    • 构建项目,运行教材相关代码

    • 修改布局让P290页的界面与教材不同

    • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分

    实验截图

    五、事件处理测试

    实验要求
    • 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十八章:

    • 构建项目,运行教材相关代码

    • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分

    实验截图

    实验总结

    步骤 耗时 百分比
    需求分析 20 13.7%
    设计 30 20.6%
    代码实现 50 34.4%
    测试 30 20.6%
    分析总结 15 10.3%
  • 相关阅读:
    Maven实战(六)依赖
    Maven实战(五)坐标详解
    Maven实战(四)生命周期
    Maven实战(三)Eclipse构建Maven项目
    Maven实战(二)构建简单Maven项目
    Maven实战(一)安装与配置
    哈佛图书馆自习室墙上的训言——觉得为时已晚的时候,恰恰是最早的时候——不是缺乏时间,而是缺乏努力
    JQuery中国省市区无刷新三级联动查询
    思科VSS配置指南
    思科IS-IS多区域和汇总配置
  • 原文地址:https://www.cnblogs.com/CTF5301/p/9062575.html
Copyright © 2011-2022 走看看