软件设计实践文档.docx

上传人:b****2 文档编号:513865 上传时间:2023-04-29 格式:DOCX 页数:34 大小:372.35KB
下载 相关 举报
软件设计实践文档.docx_第1页
第1页 / 共34页
软件设计实践文档.docx_第2页
第2页 / 共34页
软件设计实践文档.docx_第3页
第3页 / 共34页
软件设计实践文档.docx_第4页
第4页 / 共34页
软件设计实践文档.docx_第5页
第5页 / 共34页
软件设计实践文档.docx_第6页
第6页 / 共34页
软件设计实践文档.docx_第7页
第7页 / 共34页
软件设计实践文档.docx_第8页
第8页 / 共34页
软件设计实践文档.docx_第9页
第9页 / 共34页
软件设计实践文档.docx_第10页
第10页 / 共34页
软件设计实践文档.docx_第11页
第11页 / 共34页
软件设计实践文档.docx_第12页
第12页 / 共34页
软件设计实践文档.docx_第13页
第13页 / 共34页
软件设计实践文档.docx_第14页
第14页 / 共34页
软件设计实践文档.docx_第15页
第15页 / 共34页
软件设计实践文档.docx_第16页
第16页 / 共34页
软件设计实践文档.docx_第17页
第17页 / 共34页
软件设计实践文档.docx_第18页
第18页 / 共34页
软件设计实践文档.docx_第19页
第19页 / 共34页
软件设计实践文档.docx_第20页
第20页 / 共34页
亲,该文档总共34页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

软件设计实践文档.docx

《软件设计实践文档.docx》由会员分享,可在线阅读,更多相关《软件设计实践文档.docx(34页珍藏版)》请在冰点文库上搜索。

软件设计实践文档.docx

软件设计实践文档

 

软件设计实践报告

单位:

信息工程学院

班级:

09级计算机2班

学号:

2009551016

姓名:

肖帅

任课教师:

谭貌

湘潭大学

20012年8月

软件设计实践

项目名称:

ANDROID小应用——BABY玩英语

湘潭大学信息工程学院肖帅

一、项目概述

1、概述:

本应用主要适用于学龄前儿童,现今社会手机的使用越来越低龄化,本着培养儿童英语学习的兴趣和爱好,设计了这一款安卓手机小应用,儿童在娱乐的同时能感受到英语学习的魅力。

这一小应用通过风趣的画面,儿童通过点击手机屏幕,手机播放器即时播放准确的单词读音,让学龄前儿童提早感受英语学习的魅力,培养其学习英语的兴趣。

2、目的和用途:

一款安卓即时发音类英语学习小应用,在儿童全面学习英语前培养其英语学习的兴趣,为其以后的英语学习打下坚实的基础。

3、需求说明:

(1):

首先这一款安卓手机应用要做到即时性,即当用户点击了手机界面时候,标准的英语读音要在相当短的时间内从手机播放器里面放出,不能够存在长时间无反应的现象。

(2):

其次要做到完全覆盖性,即当用户进入到应用的二级界面点击了手屏幕上任意一位置(坐标),手机不能没反应,即或者播放器发声,或者提示用户重新点击手机屏幕。

4、环境要求:

Jdk1.7;

Andriod2.3.3以上版本。

二、系统分析与设计

1、系统结构图:

A

进入

 

 

2、模块/函数设计

具体模块及函数实现部分在系统实现部分有详细介绍。

3、测试方案

首先进入主界面,点击“IWANTTOPLAY”后进入选择界面,在选择界面选择具体的种类即可进入点读界面,进入此界面后点击屏幕即可发声。

若以上测试步骤有某一步或者几步没反应则需要重新检查模块的功能,直到能实现上述功能为止。

三、系统实现

1、关键模块/函数的实现

(1)下图为该应用主界面

下面代码为实现该界面的布局:

android="

xmlns:

tools="

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

gravity="bottom">

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

layout_alignParentLeft="true"

android:

layout_alignParentTop="true"

android:

orientation="vertical">

android:

id="@+id/imageView1"

android:

layout_width="317dp"

android:

layout_height="369dp"

android:

src="@drawable/bg"/>

android:

id="@+id/play"

android:

layout_width="match_parent"

android:

layout_height="65dp"

android:

layout_alignParentBottom="true"

android:

layout_alignParentLeft="true"

android:

background="@drawable/hi_light_9"

android:

text="@string/Button1"

android:

textStyle="bold"/>

以下代码为主界面实现代码:

packagecom.costa.baby;

importandroid.os.Bundle;

importandroid.app.Activity;

importandroid.content.Intent;

importandroid.graphics.AvoidXfermode.Mode;

importandroid.view.Menu;

importandroid.view.MenuItem;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.widget.Button;

importandroid.support.v4.app.NavUtils;

 

publicclassMainActivityextendsActivity

{

privateButtonbutton;

@Override

publicvoidonCreate(BundlesavedInstanceState)

{

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

Buttonbutton;

this.button=(Button)this.findViewById(R.id.play);

this.button.setOnClickListener(newOnClickListener()

{

publicvoidonClick(Viewv)

{

Intentintent=newIntent();

intent.setClass(MainActivity.this,Activity_choose.class);

startActivity(intent);

}

}

);

}

}

(2)下图为选择界面

以下代码为选择界面布局的实现:

xmlversion="1.0"encoding="utf-8"?

>

android="

android:

layout_width="match_parent"

android:

layout_height="match_parent"

android:

orientation="vertical">

android:

id="@+id/imageView1"

android:

layout_width="match_parent"

android:

layout_height="266dp"

android:

layout_weight="0.25"

android:

src="@drawable/yoci"/>

android:

id="@+id/fruit"

android:

layout_width="match_parent"

android:

layout_height="38dp"

android:

background="@drawable/hi_light_9"

android:

text="水果店"/>

android:

id="@+id/anim"

android:

layout_width="match_parent"

android:

layout_height="35dp"

android:

background="@drawable/hi_light_9"

android:

text="动物园"/>

android:

id="@+id/pro"

android:

layout_width="match_parent"

android:

layout_height="34dp"

android:

background="@drawable/hi_light_9"

android:

text="TA的职业"/>

android:

id="@+id/trans"

android:

layout_width="match_parent"

android:

layout_height="33dp"

android:

background="@drawable/hi_light_9"

android:

text="交通工具"/>

以下代码为选择界面的具体实现:

packagecom.costa.baby;

importandroid.os.Bundle;

importandroid.app.Activity;

importandroid.content.Intent;

importandroid.graphics.AvoidXfermode.Mode;

importandroid.view.Menu;

importandroid.view.MenuItem;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.widget.Button;

importandroid.support.v4.app.NavUtils;

publicclassActivity_chooseextendsActivity{

privateButtonbutton1;

privateButtonbutton4;

privateButtonbutton3;

privateButtonbutton2;

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_choose)

this.button1=(Button)this.findViewById(R.id.fruit);

this.button1.setOnClickListener(newOnClickListener(){

publicvoidonClick(Viewv){

Intentintent=newIntent();

intent.setClass(Activity_choose.this,Activity_fruit.class);

startActivity(intent);

}

});

this.button2=(Button)this.findViewById(R.id.anim);

this.button2.setOnClickListener(newOnClickListener(){

publicvoidonClick(Viewv){

Intentintent=newIntent();

intent.setClass(Activity_choose.this,Activity_anim.class);

startActivity(intent);

}

});

this.button3=(Button)this.findViewById(R.id.pro);

this.button3.setOnClickListener(newOnClickListener(){

publicvoidonClick(Viewv){

Intentintent=newIntent();

intent.setClass(Activity_choose.this,Activity_pro.class);

startActivity(intent);

}

});

this.button4=(Button)this.findViewById(R.id.trans);

this.button4.setOnClickListener(newOnClickListener(){

publicvoidonClick(Viewv){

Intentintent=newIntent();

intent.setClass(Activity_choose.this,Activity_trans.class);

startActivity(intent);

}

})

}

}

(3)下图为三级界面之一水果图:

以下为水果图布局代码的实现:

xmlversion="1.0"encoding

="utf-8"?

>

android="

android:

layout_width="match_parent"

android:

layout_height="match_parent"

android:

background="@drawable/fruit"

android:

orientation="vertical">

 

android:

id="@+id/tv1"

android:

layout_width="match_parent"

android:

layout_height="wrap_content"

android:

text=""

android:

gravity="center"

/>

以下为水果图具体代码的实现:

packagecom.costa.baby;

importjava.util.HashMap;

importandroid.media.AudioManager;

importandroid.media.MediaPlayer;

importandroid.media.SoundPool;

importandroid.os.Bundle;

importandroid.app.Activity;

importandroid.content.Context;

importandroid.graphics.AvoidXfermode.Mode;

importandroid.view.Menu;

importandroid.view.MenuItem;

importandroid.view.MotionEvent;

importandroid.widget.TextView;

importandroid.support.v4.app.NavUtils;

importandroid.content.Context;

importandroid.media.AudioManager;

importandroid.media.SoundPool;

publicclassActivity_fruitextendsActivity{

TextViewtb1;

MediaPlayerapp;

MediaPlayerlem;

MediaPlayerban;

MediaPlayerstra;

MediaPlayerorg;

MediaPlayerwat;

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_fruit);

tb1=(TextView)findViewById(R.id.tv1);

app=MediaPlayer.create(this,R.raw.apple);

lem=MediaPlayer.create(this,R.raw.lemon);

ban=MediaPlayer.create(this,R.raw.banana);

stra=MediaPlayer.create(this,R.raw.strawberry);

org=MediaPlayer.create(this,R.raw.orange);

wat=MediaPlayer.create(this,R.raw.watermelon);

}

publicbooleanonTouchEvent(MotionEventevent){

//如果是按下操作

if(event.getAction()==MotionEvent.ACTION_DOWN){

playXY(event.getX(),event.getY());

}

returnsuper.onTouchEvent(event);

}

privatevoidplayXY(floatx,floaty){

if(x>=0&&y>=0&&x<=154.5&&y<=194.5){

app.start();

tb1.setText("Apple");

}

if(x>154.5&&y>0&&y<=194.5){

lem.start();

tb1.setText("Lemon");

}

if(x>0&&y>194.5&&x<=154.5&&y<329.5){

ban.start();

tb1.setText("Banana");

}

if(x>154.5&&y>194.5&&y<329.5){

stra.start();

tb1.setText("Strawberry");

}

if(x>0&&y>=329.5&&x<=154.5){

org.start();

tb1.setText("Orange");

}

if(x>154.5&&y>=329.5){

wat.start();

tb1.setText("Watermelon");

}

}

}

 

(4)下图为职业图:

以下为职业图的布局代码实现:

xmlversion="1.0"encoding="utf-8"?

>

android="

android:

layout_width="match_parent"

android:

layout_height="match_parent"

android:

background="@drawable/pro"

android:

orientation="vertical">

 

android:

id="@+id/tv2"

android:

layout_width="match_parent"

android:

layout_height="wrap_content"

android:

gravity="center"/>

以下为职业图的具体代码实现:

packagecom.costa.baby;

 

importandroid.media.MediaPlayer;

importandroid.os.Bundle;

importandroid.app.Activity;

importandroid.graphics.AvoidXfermode.Mode;

importandroid.view.Menu;

importandroid.view.MenuItem;

importandroid.view.MotionEvent;

importandroid.widget.TextView;

importandroid.support.v4.app.NavUtils;

publicclassActivity_proextendsActivity{

 

TextViewtb1;

MediaPlayerdoc;

MediaPlayerwor;

MediaPlayerfire;

MediaPlayerpea;

MediaPlayernur;

MediaPlayerpol;

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_pr);

tb1=(TextView)findViewById(R.id.tv2);

doc=MediaPlayer.create(this,R.raw.doctor);

wor=MediaPlayer.create(this,R.raw.worker);

fire=MediaPlayer.create(this,R.raw.firefighter);

pea=MediaPlayer.create(this,R.raw.peasant);

nur=MediaPlayer.create(this,R.raw.nurse);

pol=MediaPlayer.create(this,R.raw.police);

}

publicbooleanonTouchEvent(MotionEventevent){

//如果是按下操作

if(event.getAction()==MotionEvent.ACTION_DOWN){

playXY(event.getX(),event.getY());

}

returnsu

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2