android开发计算器课程设计.docx
《android开发计算器课程设计.docx》由会员分享,可在线阅读,更多相关《android开发计算器课程设计.docx(17页珍藏版)》请在冰点文库上搜索。
android开发计算器课程设计
android开发计算器课程设计(总16页)
Android应用程序开发
实验报告
学号:
5
学生姓名:
冯会会
指导教师:
齐兵辉
提交时间:
第一章系统分析与设计
系统的可行性分析
可行性研究是为了弄清楚系统开发的项目是不是可以实现和值得进行研究的过程,实际上是一次大大简化系统分析和系统设计的过程,所以,进行可执行性的分析是非常必要的,也是很重要的,经过最初的设计目标和进行的实时调查得出以下四点的可行性分析:
(1)技术可行性:
Eclipse+AndroidADT的技术已经较为成熟,通过SUN公司(现被ORCEL公司收购)推出的跨平台、动态的JAVA语言进行开发。
(2)运行可行性:
该系统需要Android虚拟机环境,Eclipse中安装ADT,DDMS等GoogleAndroid相关插件。
其运行环境已经相当稳定,它功能丰富,包括了完备的Android程序的编码、调试、测试和发布功能,其中支持所有Android应用开发相关技术,包括SQLite,Skia,3D制作,AndroidXML,能够很好的发布Android的应用程序APK包。
(3)法律可行性:
因为是自主开发设计,所以不会构成侵权,在法律上是可行的。
通过以上的可行性分析,将采用Eclipse+AndroidADT+DDMS技术,运用JAVA语言进行系统的开发。
系统的需求分析
根据分析需求,这个系统必须实现以下的功能:
(1)实现简单的数字计算功能。
作为计算器,其核心就是加减乘除。
(2)能够在手机里面以良好的界面。
第二章系统详细设计
activity的详细设计
packageclassMainActivityextendsActivity{
privateTextViewtextView1=null;
privateButtonbuttonzone=null;
privateButtonbutton1=null;
privateButtonbutton2=null;
privateButtonbutton3=null;
privateButtonbutton4=null;
privateButtonbutton5=null;
privateButtonbutton6=null;
privateButtonbutton7=null;
privateButtonbutton8=null;
privateButtonbutton9=null;
privateButtonbuttonadd=null;
privateButtonbuttonred=null;
privateButtonbuttondiv=null;
privateButtonbuttonmul=null;
privateButtonbuttonpint=null;
privateButtonbuttonbai=null;
privateButtonbuttongen=null;
privateButtonbuttonequal=null;
privateStringx="";
privateStringy="";
privatedoubler1=0;
privatedoubler2=0;
privateinti=0;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
(savedInstanceState);
setContentViewtextView1=(TextView)findViewByIdbutton1=(Button)findViewByIdbutton2=(Button)findViewByIdbutton3=(Button)findViewByIdbutton4=(Button)findViewByIdbutton5=(Button)findViewByIdbutton6=(Button)findViewByIdbutton7=(Button)findViewByIdbutton8=(Button)findViewByIdbutton9=(Button)findViewByIdbuttonzone=(Button)findViewByIdbuttonadd=(Button)findViewByIdbuttonred=(Button)findViewByIdbuttonmul=(Button)findViewByIdbuttondiv=(Button)findViewByIdbuttonbai=(Button)findViewByIdbuttongen=(Button)findViewByIdbuttonequal=(Button)findViewByIdbuttonpint=(Button)findViewById
(newOnClickListener(){
@Override
publicvoidonClick(Viewarg0){
+"";
y=0+"."+"";
}
else{
x=x+".";
y=y+".";
(y);
}
}
});
(newOnClickListener(){
@Override
publicvoidonClick(Viewarg0){
getMenuInflater().inflatemenu);
returntrue;
}
}
xml文件的详细设计
android=""
xmlns:
tools=""
android:
layout_width="wrap_content"
android:
layout_height="wrap_content"
android:
orientation="horizontal"
android:
layout_gravity="center"
android:
columnCount="5"
android:
rowCount="5"
tools:
context=".MainActivity">
android:
id="@+id/textView1"
android:
layout_width="230dp"
android:
layout_height="30dp"
android:
layout_column="0"
android:
layout_columnSpan="5"
android:
layout_row="0"
android:
gravity="right"
android:
text="@string/result"
android:
textSize="25sp"/>