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