标签:
选择的两个平台:网页+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
标签:
原文地址:http://www.cnblogs.com/smtc/p/5854093.html