2018-2019-2 20175232 实验四《Android程序设计》实验报告

2018-2019-2 20175232 实验四《Android程序设计》实验报告---恢复内容开始---

- Android程序设计-1

    • 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调试应用程序
      下载安装并配置Android SDK
      参考Android开发简易教程安装Android Studio
    • 安装好虚拟环境

    • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

      创建好helloworld项目

    • 修改helloworld
    • 修改效果
    • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

-Android程序设计-2

    • Activity测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十五章:
      • 构建项目,运行教材相关代码
      • 创建 ThirdActivity,在ThirdActivity中显示自己的学号,修改代码让MainActivity启动ThirdActivity
      • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分实验步骤
      • 新建项目

      • 修改代码
      • 运行结果
      • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

         

      • -Android程序设计-3

        • UI测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十六章:
        • 构建项目,运行教材相关代码
        • 修改代码让Toast消息中显示自己的学号信息
        • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
          实验步骤
        • 修改代码

      • 运行结果
      • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

      •  

      • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

---恢复内容结束---

- Android程序设计-1

    • 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调试应用程序
      下载安装并配置Android SDK
      参考Android开发简易教程安装Android Studio
    • 安装好虚拟环境

    • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

      创建好helloworld项目

    • 修改helloworld
    • 修改效果
    • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

-Android程序设计-2

    • Activity测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十五章:
      • 构建项目,运行教材相关代码
      • 创建 ThirdActivity,在ThirdActivity中显示自己的学号,修改代码让MainActivity启动ThirdActivity
      • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分实验步骤
      • 新建项目

      • 修改代码
      • 运行结果
      • 2018-2019-2 20175232 实验四《Android程序设计》实验报告

         

      • -Android程序设计-3

        • UI测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十六章:
        • 构建项目,运行教材相关代码
        • 修改代码让Toast消息中显示自己的学号信息
        • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
          实验步骤
        • 修改代码

      • 运行结果
      •  2018-2019-2 20175232 实验四《Android程序设计》实验报告


      • -Android程序设计-4

          • 布局测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十七章:
          • 构建项目,运行教材相关代码
          • 修改布局让P290页的界面与教材不同
          • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
            实验步骤
          • 界面设计2018-2019-2 20175232 实验四《Android程序设计》实验报告

            • -Android程序设计-5

              • 事件处理测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十八章:
              • 构建项目,运行教材相关代码
                • 代码
                • MainActivity.java
                package com.example.helloworld;
                
                import android.support.v7.app.AppCompatActivity;
                import android.os.Bundle;
                import android.app.Activity;
                import android.graphics.Color;
                import android.os.Bundle;
                import android.view.Menu;
                import android.view.View;
                import android.widget.AnalogClock;
                import android.app.Activity;
                import android.graphics.Color;
                import android.os.Bundle;
                import android.view.Menu;
                import android.view.View;
                import android.widget.AnalogClock;
                
                import com.example.helloworld.R;
                
                public class MainActivity extends Activity {
                    int counter = 0;
                    int[] colors = { Color.BLACK, Color.BLUE, Color.CYAN,
                            Color.DKGRAY, Color.GRAY, Color.GREEN, Color.LTGRAY,
                            Color.MAGENTA, Color.RED, Color.WHITE, Color.YELLOW };
                    @Override
                    protected void onCreate(Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                        setContentView(R.layout.activity_main);
                    }
                    @Override
                    public boolean onCreateOptionsMenu(Menu menu) {
                        getMenuInflater().inflate(R.menu.menu_main, menu);
                        return true;
                    }
                    public void changeColor(View view) {
                        if (counter == colors.length) {
                            counter = 0;
                        }
                        view.setBackgroundColor(colors[counter++]);
                    }
                }
                • activity_main
                <?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=".MainActivity">
                
                   <Button
                       android:id="@+id/button1"
                       android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:text="启动另一个activity"
                       tools:ignore="MissingConstraints" />
                   <TextView
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:layout_marginEnd="80dp"
                       android:layout_marginRight="80dp"
                       android:text="Hello 20175333"
                       app:layout_constraintBottom_toBottomOf="parent"
                       app:layout_constraintEnd_toEndOf="parent"
                       app:layout_constraintLeft_toLeftOf="parent"
                       app:layout_constraintRight_toRightOf="parent"
                       app:layout_constraintTop_toTopOf="parent"
                       tools:text="Hello World!20175333" />
                   <RelativeLayout
                       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"
                       android:paddingBottom="10dp"
                       android:paddingLeft="10dp"
                       android:paddingRight="10dp"
                       android:paddingTop="10dp"
                       tools:context=".MainActivity">
                       <AnalogClock
                           android:id="@+id/analogClock1"
                           android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
                           android:layout_alignParentTop="true"
                           android:layout_centerHorizontal="true"
                           android:layout_marginTop="90dp"
                           android:onClick="changeColor"
                           />
                   </RelativeLayout>
                </android.support.constraint.ConstraintLayout>
              • 实验结果
                2018-2019-2 20175232 实验四《Android程序设计》实验报告

                 

                
                

2018-2019-2 20175232 实验四《Android程序设计》实验报告

上一篇:[Vue]axios的使用


下一篇:python基础教程_学习笔记18:标准库:一些最爱——shelve