現代軟體工程課程作業 第一章14題

來源:互聯網
上載者:User

標籤:

選擇的兩個平台:網頁+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題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.