现代软件工程课程作业 第一章14题

选择的两个平台:网页+android

1.平台:网页

编程语言:html5

软件的构建环境:Notepad++ 6.9.2    Google Chrome 51.0.2704.106  

软件工程的工具:Git

开发的流程:

最后的源码:

<html>
<head><title>test</title></head>
<body color = 'green'>
<marquee>
<font size='18'>hello,world;</font>
</marquee>
</body>
</html>

用户的界面:

 

2.平台:Android

编程语言:java

软件的构建环境:Jdk-8u101-windows-x64  Eclipse1.4.1  Android4.4 

软件工程的工具:Git

开发的流程:

最后的源码:

java代码:

package com.example.homework;
import java.util.Timer;
import java.util.TimerTask;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
public class MainActivity extends ActionBarActivity {
	TextView tv;
	int flag =0;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		tv = (TextView) this.findViewById(R.id.tv);
		timer.schedule(task, 1000, 1000); 
	}
	
	Handler handler = new Handler() {  
        public void handleMessage(Message msg) {  
            if (msg.what == 0) {  
            	tv.setTextColor(android.graphics.Color.GREEN);
            }
            if (msg.what == 1) {  
            	tv.setTextColor(android.graphics.Color.RED);
            }
            if (msg.what == 2) {  
            	tv.setTextColor(android.graphics.Color.BLUE);
            }
            super.handleMessage(msg);  
        };  
    };  
    Timer timer = new Timer();  
    TimerTask task = new TimerTask() {  
        public void run() {  
            // 需要做的事:发送消息  
            Message message = new Message();
            
            message.what = (flag++)%3;  
            handler.sendMessage(message);  
        }  
    };  
}

xml代码:

<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">

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textSize="80dp"
        android:text="Hello World!" />
</RelativeLayout>

用户的界面:

沈幸博

2016/9/9

转载于:https://www.cnblogs.com/smtc/p/5854093.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值