20155224 实验四 Android程序设计

任务一

Android Stuidio的安装测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十四章:

  • 安装 Android Stuidio
  • 完成Hello World, 要求修改res目录中的内容,Hello World后要显示自己的学号,提交代码运行截图和码云Git链接,截图没有学号要扣分
  • 学习Android Stuidio调试应用程序
<?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="com.example.a1.helloworld.MainActivity"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello World!20155205聂小益"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链接,截图要有学号水印,否则会扣分
package com.example.Calpernia.helloworld;import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// setContentView(R.layout.activity_main);setContentView(R.layout.activity_third);}
}

任务三

UI测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十六章:

  • 构建项目,运行教材相关代码
  • 修改代码让Toast消息中显示自己的学号信息
  • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
package com.example.Calpernia.toast;import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Button button = (Button) findViewById(R.id.button);button.setOnClickListener(new View.OnClickListener(){@Overridepublic void onClick(View v){Toast toast = Toast.makeText(MainActivity.this,"20155205", Toast.LENGTH_LONG);toast.show();}});}
}

任务四

布局测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十七章:

  • 构建项目,运行教材相关代码
  • 修改布局让P290页的界面与教材不同
  • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
<?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="com.example.a1.relativelayout.MainActivity"><Buttonandroid:id="@+id/button"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Cancel"app:layout_constraintLeft_toLeftOf="parent"android:layout_marginLeft="8dp"android:layout_marginRight="8dp"app:layout_constraintRight_toRightOf="parent"app:layout_constraintTop_toTopOf="parent"android:layout_marginTop="16dp"app:layout_constraintHorizontal_bias="0.932" /><Buttonandroid:id="@+id/button2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Save"android:layout_marginRight="8dp"android:layout_marginLeft="8dp"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintRight_toLeftOf="@+id/button"app:layout_constraintTop_toTopOf="parent"android:layout_marginTop="16dp"app:layout_constraintHorizontal_bias="0.151" /><ImageViewandroid:id="@+id/imageView"android:layout_width="96dp"android:layout_height="84dp"app:srcCompat="@android:drawable/presence_audio_online"android:layout_marginRight="8dp"app:layout_constraintRight_toRightOf="parent"android:layout_marginLeft="8dp"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintBottom_toBottomOf="parent"android:layout_marginBottom="46dp" /><Buttonandroid:id="@+id/button3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Share"android:layout_marginBottom="8dp"app:layout_constraintBottom_toTopOf="@+id/imageView"app:layout_constraintTop_toTopOf="parent"android:layout_marginTop="8dp"android:layout_marginRight="8dp"app:layout_constraintVertical_bias="0.501"app:layout_constraintRight_toRightOf="parent"android:layout_marginLeft="8dp"app:layout_constraintLeft_toLeftOf="parent" /><Buttonandroid:id="@+id/button4"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Delete"app:layout_constraintRight_toLeftOf="@+id/button5"android:layout_marginRight="8dp"android:layout_marginLeft="8dp"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintHorizontal_bias="0.139"android:layout_marginTop="55dp"app:layout_constraintTop_toBottomOf="@+id/button2"app:layout_constraintBottom_toBottomOf="parent"android:layout_marginBottom="8dp" /><Buttonandroid:id="@+id/button5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Filter"android:layout_marginRight="27dp"app:layout_constraintRight_toRightOf="parent"android:layout_marginTop="55dp"app:layout_constraintTop_toBottomOf="@+id/button"app:layout_constraintBottom_toBottomOf="parent"android:layout_marginBottom="8dp" /></android.support.constraint.ConstraintLayout>

任务五

事件处理测试: 参考《Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)》第二十八章:

  • 构建项目,运行教材相关代码
  • 提交代码运行截图和码云Git链接,截图要有学号水印,否则会扣分
package com.example.a1.multicolorclock;import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.graphics.Color;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 };@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}@Overridepublic 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++]);}
}

转载于:https://www.cnblogs.com/nxy970408/p/6886338.html

# 20155224 实验四 Android程序设计相关推荐

  1. 20155321 实验四 Android程序设计

    20155321 实验四 Android程序设计 安装Android studio成功 任务一:Android Stuidio的安装测试: 参考<Java和Android开发学习指南(第二版)( ...

  2. 20165235实验四 Android程序设计

    20165235实验四 Android程序设计 实验课程:JAVA编程设计 实验名称:Android开发 姓名:祁瑛 学号:20165235 实验时间:2018.05.16 指导老师:娄家鹏 Andr ...

  3. 实验四 Android程序设计

    实验四 Android程序设计 课程:Java程序设计 班级:1652 姓名:孔月 学号:20165208 指导教师:娄嘉鹏 实验日期:2018.5.14 实验名称:Android程序设计 实验要求: ...

  4. 20155330 实验四 Android程序设计

    20155330 实验四 Android程序设计 实验内容 1.基于Android Studio开发简单的Android应用并部署测试; 2.了解Android.组件.布局管理器的使用: 3.掌握An ...

  5. 20165226 实验四 Android程序设计

    实验四 Android程序设计 实验目的 一.Android Studio的安装测试 二.Activity测试 三.UI测试 四.布局测试 五.事件处理测试 实验内容及步骤 (一)Android St ...

  6. 20155314 2016-2017-2 《Java程序设计》实验四 Android程序设计

    20155314 2016-2017-2 <Java程序设计>实验四 Android程序设计 实验任务 基于Android Studio开发简单的Android应用并部署测试 了解Andr ...

  7. #20165323 Java实验四 Android程序设计

    一.实验报告封面 课程:Java程序设计 班级:1653班 姓名:杨金川 学号:20165323 指导教师:娄嘉鹏 实验日期:2018年5月14日 实验时间:13:45 - 15:25 实验序号:实验 ...

  8. 20155238 实验四 Android程序设计

    Android 安装Android Studio 按照教程依次完成安装步骤.安装所存的相应文件夹必须纯英文,不能出现特殊字符. 32位系统和64位系统是同一个安装文件.启动程序中32位与64位都有.根 ...

  9. 2018-2019-2 实验四 Android程序设计

    实验要求 参考Android开发简易教程 完成云班课中的检查点,也可以先完成实验报告,直接提交.注意不能只有截图,要有知识点,原理,遇到的问题和解决过程等说明.实验报告中一个检查点要有多张截图. 发表 ...

最新文章

  1. 同一html页面中不同链接的不同样式
  2. java实例变量成员变量_Java的类成员变量、实例变量、类变量,成员方法、实例方法、类方法...
  3. hdu2413 二分+二分匹配
  4. opencv生成随机图(随机彩图,随机灰图)
  5. 三维家可以导入别人的方案吗_Candel3D | 山地等高线看着费劲,不如试试三维设计...
  6. python 操作 表格
  7. 解决ASP.NET Core部署到IIS,更新项目另一个程序正在使用此文件,进程无法访问...
  8. android h5选择图片上传,js-微信H5选择多张图片预览并上传(兼容ios,安卓,已测试)...
  9. 基于 Linux 和 MiniGUI 的嵌入式系统软件开发指南(三)
  10. MVC利用Routing实现多域名绑定一个站点、二级域名以及二级域名注册Area
  11. opencv中滚动条操作
  12. 数组模拟栈解决括号匹配
  13. 制作 MacOS 系统 ISO 镜像
  14. 简单git用ssh方式下载代码
  15. 如何用计算机弹黑人抬棺简谱,光遇黑人抬棺竖琴简谱 数字简谱简单弹奏教学...
  16. 30ea什么意思_ea阶段是什么?你未必全知道!
  17. trove 创建实例源码分析
  18. 这俩工具,好用到绝绝子
  19. YOLOv5、v7改进之三十一:CrissCrossAttention注意力机制
  20. 互斥锁 、 自旋锁、读写锁和RCU锁

热门文章

  1. 科大讯飞发布第三季度业绩报告:扣非净利润同比减少近9成
  2. 旷视COCO获奖团队亲述:我们是如何两年拿下7个冠军的
  3. 人脸识别冤枉了98%的好人,伦敦警察局长:我很满意
  4. 乔丹LeCun李开复隔空对话:我们对智能一无所知;AI研究的12大趋势
  5. 引领架构创新之路第八届系统架构师大会撼世来袭
  6. 口头禅可能让你丢掉工作,你所不知道的工作沟通禁忌
  7. oracle 制定定时任务
  8. POJ-1328 Radar Installation 贪心
  9. 【转】JVM内存管理:深入垃圾收集器与内存分配策略
  10. 为学校食堂提供“自提柜”,爽提获650万元Pre-A轮融资