The first chapter 14 Questions of modern software engineering course assignment

Source: Internet
Author: User

Two platforms selected: Web +android

1. Platform: web

Programming Language: HTML5

Software build Environment: notepad++ 6.9.2 Google Chrome 51.0.2704.106

Tools for Software engineering: Git

The process of development:

The final source code:

2. Platform: Android

Programming Language: Java

Software build Environment: jdk-8u101-windows-x64 Eclipse1.4.1 Android4.4

Tools for Software engineering: Git

The process of development:

The final source code:

Java code:

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 () {//= what needs to be done: Send Message msg =                        New Message ();              Message.what = (flag++)%3;          Handler.sendmessage (message);  }      }; }

XML code:

<Relativelayoutxmlns: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">    <TextViewAndroid: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>

User's interface:

Shen

2016/9/9

The first chapter 14 Questions of modern software engineering course assignment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.