標籤:
選擇的兩個平台:網頁+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
現代軟體工程課程作業 第一章14題