Android课程设计报告书.docx
《Android课程设计报告书.docx》由会员分享,可在线阅读,更多相关《Android课程设计报告书.docx(14页珍藏版)》请在冰豆网上搜索。
Android课程设计报告书
题目:
RFID药品WMS仓库管理系统
院(系)别交通与物流工程学院
专业物联网工程专业
班级物联132
成员
指导教师贾雁
二○一六年六月
一、
二、
三、
四、主体内容
4.2程序结构图
0
五、总结
六、参考文献7
一、摘要
随着智能手机的快速普及,智能手机操作系统市场风生水起。
为了让智能手机用户能够随时随地的查询互联网所提供的服务,一种高效的办法就是将应用系统的功能拓展到手机终端上,让手机能够通过移动网以及互联网访问Web网站并处理各种各样业务。
因此,智能手机的应用软件及其需要的服务将有广阔的发展前景。
在如今这个智能手机系统群雄纷争的时候,2008年Google推出了一款名为Android的开源智能手机操作系统。
它的最大特点是其开放性体系架构,不仅具有非常好的开发、调试环境,而且还支持各种可扩展的用户体验,包括丰富的图形组件、多媒体支持功能以及强大的浏览器。
本文是关于Android技术基础的RFID药品WMS仓库管理系统。
关键字:
Android智能手机仓库管理系统
二、课题及要求
1、课题:
2、目的:
1)复习、巩固Android相关技术的基础知识,进一步加深对Android开发技术的理解和掌握;
2)课程设计为学生提供了一个既动手又动脑,独立实践的机会,将课本上的理论知识和实际有机的结合起来,锻炼学生的分析解决实际问题的能力;
3)培养学生在项目开发中团队合作精神、创新意识及能力。
3、要求:
1)对系统进行功能模块分析,符合课题要求,实现相应功能
2)系统设计要实用,编程简练,可用,功能全面
3)说明书、流程图要清楚
三、程序功能简介
经过一系列的编程与实验之后,能够实现简单的一下操作:
登录界面,实现药品的入库、移库、盘点、药品有效期提醒、出库等功能。
4.1设计分析
这是一个基于Android技术基础的RFID药品WMS仓库管理系统。
,这次的课程设计我们主要是应用现有的Eclipse软件,实现药品仓库管理的相关操作。
设计中包括用户界面登录和操作界面。
在登录界面又包括注册跟登录及密码的设置,在操作界面包含入库管理、移库管理、出库管理、盘点查询及有效期提醒等。
4.3模块功能及程序说明
android:layout_height="wrap_content"android:layout_width="200sp"android:id="@+id/edi1"android:hint="请输入用户名"android:textColor="@drawable/gaoliang"android:singleLine="true"android:layout_alignParentRight="true"android:layout_marginTop="180sp"/>android:id="@+id/text2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户名:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi1"android:paddingTop="7sp"android:layout_toLeftOf="@id/edi1"/>android:textColor="@drawable/gaoliang"android:layout_height="wrap_content"android:layout_width="200sp"android:id="@+id/edi2"android:singleLine="true"android:hint="请输入密码"android:password="true"android:layout_below="@id/edi1"android:layout_alignParentRight="true"/>android:id="@+id/text3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi2"android:paddingTop="6dip"android:layout_toLeftOf="@id/edi2"/>android:id="@+id/btn1"android:layout_width="100sp"android:layout_height="wrap_content"android:text="登陆"android:layout_alignLeft="@id/edi2"android:layout_below="@id/edi2"android:onClick="onload"/>android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
android:
layout_height="wrap_content"
layout_width="200sp"
id="@+id/edi1"
hint="请输入用户名"
textColor="@drawable/gaoliang"
singleLine="true"
layout_alignParentRight="true"
layout_marginTop="180sp"/>
android:id="@+id/text2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户名:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi1"android:paddingTop="7sp"android:layout_toLeftOf="@id/edi1"/>android:textColor="@drawable/gaoliang"android:layout_height="wrap_content"android:layout_width="200sp"android:id="@+id/edi2"android:singleLine="true"android:hint="请输入密码"android:password="true"android:layout_below="@id/edi1"android:layout_alignParentRight="true"/>android:id="@+id/text3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi2"android:paddingTop="6dip"android:layout_toLeftOf="@id/edi2"/>android:id="@+id/btn1"android:layout_width="100sp"android:layout_height="wrap_content"android:text="登陆"android:layout_alignLeft="@id/edi2"android:layout_below="@id/edi2"android:onClick="onload"/>android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
id="@+id/text2"
layout_width="wrap_content"
text="用户名:
"
textColor="@android:
color/black"
textSize="20dip"
layout_alignTop="@id/edi1"
paddingTop="7sp"
layout_toLeftOf="@id/edi1"
/>
android:textColor="@drawable/gaoliang"android:layout_height="wrap_content"android:layout_width="200sp"android:id="@+id/edi2"android:singleLine="true"android:hint="请输入密码"android:password="true"android:layout_below="@id/edi1"android:layout_alignParentRight="true"/>android:id="@+id/text3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi2"android:paddingTop="6dip"android:layout_toLeftOf="@id/edi2"/>android:id="@+id/btn1"android:layout_width="100sp"android:layout_height="wrap_content"android:text="登陆"android:layout_alignLeft="@id/edi2"android:layout_below="@id/edi2"android:onClick="onload"/>android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
id="@+id/edi2"
hint="请输入密码"
password="true"
layout_below="@id/edi1"
android:id="@+id/text3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textColor="@android:color/black"android:textSize="20dip"android:layout_alignTop="@id/edi2"android:paddingTop="6dip"android:layout_toLeftOf="@id/edi2"/>android:id="@+id/btn1"android:layout_width="100sp"android:layout_height="wrap_content"android:text="登陆"android:layout_alignLeft="@id/edi2"android:layout_below="@id/edi2"android:onClick="onload"/>android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
id="@+id/text3"
text="密码:
layout_alignTop="@id/edi2"
paddingTop="6dip"
layout_toLeftOf="@id/edi2"/>
android:id="@+id/btn1"android:layout_width="100sp"android:layout_height="wrap_content"android:text="登陆"android:layout_alignLeft="@id/edi2"android:layout_below="@id/edi2"android:onClick="onload"/>android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
id="@+id/btn1"
layout_width="100sp"
text="登陆"
layout_alignLeft="@id/edi2"
layout_below="@id/edi2"
onClick="onload"
android:id="@+id/btn2"android:layout_width="100sp"android:layout_height="wrap_content"android:text="注册"android:layout_below="@id/edi2"android:layout_toRightOf="@id/btn1"android:onClick="onres"packagesheji.kecheng;importsheji.kecheng.R;/***用户注册页面*/publicclassUserRegisterextendsActivity{privateEditTextname;privateEditTextpass;privateEditTextpasssure;privateEditTextworkid;SqlHelpdemodb;SQLiteDatabasesDatabase=null;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();}publicvoidsure(Viewv){db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);sDatabase=db.getWritableDatabase();if(name.getText().toString().equals("")||pass.getText().toString().equals("")||passsure.getText().toString().equals("")||workid.getText().toString().equals("")){DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!");}elseif(!pass.getText().toString().equals(passsure.getText().toString())){DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!");}else{Stringename=name.getText().toString();Stringepass=pass.getText().toString();Stringeid=workid.getText().toString();//查询语句StringselectStr="selectusernamefromuser_info";Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);select_cursor.moveToFirst();Stringstring=null;do{try{string=select_cursor.getString(0);}catch(Exceptione){//TODO:handleexceptionstring="";}if(string.equals(ename)){DialogDemo.builder(UserRegister.this,"错误信息","用户名已存在,请另设用户名");select_cursor.close();break;}}while(select_cursor.moveToNext());//没有重名注册开始if(!string.equals(ename)){//定义IDintid=0;Stringselect="selectmax(_id)fromuser_info";CursorseCursor=sDatabase.rawQuery(select,null);try{seCursor.moveToFirst();id=Integer.parseInt(seCursor.getString(0));id+=1;}catch(Exceptione){//TODO:handleexceptionid=0;}sDatabase.execSQL("insertintouser_infovalues('"+id+"','"+ename+"','"+epass+"','"+eid+"')");DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");seCursor.close();}}}}packagesheji.kecheng;importsheji.kecheng.R;/***主菜单页面**@author宫玮钰**/publicclassMenuDemoextendsTabActivity{privateButtontianjia1;//添加用户键privateButtonxiugai1;//修改用户键privateButtonshanchu1;//删除用户键privateButtonchaxun1;//查询用户键privateButtontianjia2;//添加商品键privateButtonxiugai2;//修改商品键privateButtonshanchu2;//删除商品键privateButtonchaxun2;//查询商品键privateButtontianjia3;//添加供应商键privateButtonxiugai3;//修改供应商键privateButtonshanchu3;//删除供应商键privateButtonchaxun3;//查询供应商键privateButtontianjia4;//添加入库键privateButtonxiugai4;//修改入库键privateButtonshanchu4;//删除入库键privateButtonchaxun4;//查询入库键privateButtontianjia5;//添加出库键privateButtonxiugai5;//修改出库键privateButtonshanchu5;//删除出库键privateButtonchaxun5;//查询出库键privateButtonyonghu;//用户管理键privateButtonmima;//修改密码键Stringnames=null;protectedvoidonCreate(BundlesavedInstanceState){//TODOAuto-generatedmethodstubsuper.onCreate(savedInstanceState);TabHosttab=getTabHost();tab.setPadding(0,-30,0,0);tab.setDrawingCacheBackgroundColor(Color.BLUE);LayoutInflaterinf=getLayoutInflater();Bundlename=getIntent().getExtras();names=name.getString("username");/***tabhost.tabspec创建*/finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");tabs1.setIndicator("入库管理",null);finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");tabs2.setIndicator("移库管理",null);finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");tabs3.setIndicator("盘点查询",null);finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");tabs4.setIndicator("出库管理",null);finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");tabs5.setIndicator("有效期提醒",null);finalTabHost.TabSpectabs6=tab.newTabSpec("关于");tabs6.setIndicator("关于",null);tab.addTab(tabs1);tab.addTab(tabs2);tab.addTab(tabs4);tab.addTab(tabs3);tab.addTab(tabs5);tab.addTab(tabs6);}/***商品信息按钮监听**@paramv*/publicvoidonshangpin(Viewv){tianjia1.setVisibility(View.VISIBLE);}/***供应商信息按钮监听**@paramv*/publicvoidongongyingshang(Viewv){tianjia3.setVisibility(View.VISIBLE);xiugai3.setVisibility(View.VISIBLE);shanchu3.setVisibility(View.VISIBLE);chaxun3.setVisibility(View.VISIBLE);tianjia2.setVisibility(View.INVISIBLE);xiugai2.setVisibility(View.INVISIBLE);shanchu2.setVisibility(View.INVISIBLE);chaxun2.setVisibility(View.INVISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);}/***客户信息按钮监听**@paramv*/publicvoidonkehu(Viewv){tianjia2.setVisibility(View.VISIBLE);xiugai2.setVisibility(View.VISIBLE);shanchu2.setVisibility(View.VISIBLE);chaxun2.setVisibility(View.VISIBLE);tianjia1.setVisibility(View.INVISIBLE);xiugai1.setVisibility(View.INVISIBLE);shanchu1.setVisibility(View.INVISIBLE);chaxun1.setVisibility(View.INVISIBLE);tianjia3.setVisibility(View.INVISIBLE);xiugai3.setVisibility(View.INVISIBLE);shanchu3.setVisibility(View.INVISIBLE);chaxun3.setVisibility(View.INVISIBLE);}/***商品入库信息按钮监听**@paramv*/publicvoidonruku(Viewv){tianjia4.setVisibility(View.VISIBLE);xiugai4.setVisibility(View.VISIBLE);shanchu4.setVisibility(View.VISIBLE);chaxun4.setVisibility(View.VISIBLE);tianjia5.setVisibility(View.INVISIBLE);xiugai5.setVisibility(View.INVISIBLE);shanchu5.setVisibility(View.INVISIBLE);chaxun5.setVisibility(View.INVISIBLE);}*添加出库按钮监听**@paramv*/publicvoidtianjiac(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Tianjiac.class);startActivity(intent);}/***用户管理按钮监听**@paramv*/publicvoidyonghu(Viewv){Intentintent=newIntent();Bundlebundle=newBundle();bundle.putString("username",names);intent.putExtras(bundle);intent.setClass(getApplicationContext(),Yonghu.class);startActivity(intent);}publicvoidkucun(Viewv){Intentintent=newIntent();intent.setClass(MenuDemo.this,Kucun.class);startActivity(intent);}}五、总结通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。六、参考文献13公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
id="@+id/btn2"
text="注册"
layout_toRightOf="@id/btn1"
onClick="onres"
packagesheji.kecheng;
importsheji.kecheng.R;
/**
*用户注册页面
*/
publicclassUserRegisterextendsActivity{
privateEditTextname;
privateEditTextpass;
privateEditTextpasssure;
privateEditTextworkid;
SqlHelpdemodb;
SQLiteDatabasesDatabase=null;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
db=newSqlHelpdemo(getApplicationContext(),"store.db",null,1);
sDatabase=db.getWritableDatabase();
}
publicvoidsure(Viewv){
if(name.getText().toString().equals("")
||pass.getText().toString().equals("")
||passsure.getText().toString().equals("")
||workid.getText().toString().equals("")){
DialogDemo.builder(UserRegister.this,"错误信息","请填写完整信息!
");
}elseif(!
pass.getText().toString()
.equals(passsure.getText().toString())){
DialogDemo.builder(UserRegister.this,"错误信息","两次密码输入不一致!
}else{
Stringename=name.getText().toString();
Stringepass=pass.getText().toString();
Stringeid=workid.getText().toString();
//查询语句
StringselectStr="selectusernamefromuser_info";
Cursorselect_cursor=sDatabase.rawQuery(selectStr,null);
select_cursor.moveToFirst();
Stringstring=null;
do{
try{
string=select_cursor.getString(0);
}catch(Exceptione){
//TODO:
handleexception
string="";
if(string.equals(ename)){
DialogDemo.builder(UserRegister.this,"错误信息",
"用户名已存在,请另设用户名");
select_cursor.close();
break;
}while(select_cursor.moveToNext());
//没有重名注册开始
if(!
string.equals(ename)){
//定义ID
intid=0;
Stringselect="selectmax(_id)fromuser_info";
CursorseCursor=sDatabase.rawQuery(select,null);
seCursor.moveToFirst();
id=Integer.parseInt(seCursor.getString(0));
id+=1;
id=0;
sDatabase.execSQL("insertintouser_infovalues('"+id+"','"
+ename+"','"+epass+"','"+eid+"')");
DialogDemo.builder(UserRegister.this,"提示","注册成功,请返回登录界面登录");
seCursor.close();
*主菜单页面
*
*@author宫玮钰
publicclassMenuDemoextendsTabActivity{
privateButtontianjia1;//添加用户键
privateButtonxiugai1;//修改用户键
privateButtonshanchu1;//删除用户键
privateButtonchaxun1;//查询用户键
privateButtontianjia2;//添加商品键
privateButtonxiugai2;//修改商品键
privateButtonshanchu2;//删除商品键
privateButtonchaxun2;//查询商品键
privateButtontianjia3;//添加供应商键
privateButtonxiugai3;//修改供应商键
privateButtonshanchu3;//删除供应商键
privateButtonchaxun3;//查询供应商键
privateButtontianjia4;//添加入库键
privateButtonxiugai4;//修改入库键
privateButtonshanchu4;//删除入库键
privateButtonchaxun4;//查询入库键
privateButtontianjia5;//添加出库键
privateButtonxiugai5;//修改出库键
privateButtonshanchu5;//删除出库键
privateButtonchaxun5;//查询出库键
privateButtonyonghu;//用户管理键
privateButtonmima;//修改密码键
Stringnames=null;
//TODOAuto-generatedmethodstub
TabHosttab=getTabHost();
tab.setPadding(0,-30,0,0);
tab.setDrawingCacheBackgroundColor(Color.BLUE);
LayoutInflaterinf=getLayoutInflater();
Bundlename=getIntent().getExtras();
names=name.getString("username");
*tabhost.tabspec创建
finalTabHost.TabSpectabs1=tab.newTabSpec("入库管理");
tabs1.setIndicator("入库管理",null);
finalTabHost.TabSpectabs2=tab.newTabSpec("移库管理");
tabs2.setIndicator("移库管理",null);
finalTabHost.TabSpectabs3=tab.newTabSpec("盘点查询");
tabs3.setIndicator("盘点查询",null);
finalTabHost.TabSpectabs4=tab.newTabSpec("出库管理");
tabs4.setIndicator("出库管理",null);
finalTabHost.TabSpectabs5=tab.newTabSpec("有效期提醒");
tabs5.setIndicator("有效期提醒",null);
finalTabHost.TabSpectabs6=tab.newTabSpec("关于");
tabs6.setIndicator("关于",null);
tab.addTab(tabs1);
tab.addTab(tabs2);
tab.addTab(tabs4);
tab.addTab(tabs3);
tab.addTab(tabs5);
tab.addTab(tabs6);
*商品信息按钮监听
*@paramv
publicvoidonshangpin(Viewv){
tianjia1.setVisibility(View.VISIBLE);
*供应商信息按钮监听
publicvoidongongyingshang(Viewv){
tianjia3.setVisibility(View.VISIBLE);
xiugai3.setVisibility(View.VISIBLE);
shanchu3.setVisibility(View.VISIBLE);
chaxun3.setVisibility(View.VISIBLE);
tianjia2.setVisibility(View.INVISIBLE);
xiugai2.setVisibility(View.INVISIBLE);
shanchu2.setVisibility(View.INVISIBLE);
chaxun2.setVisibility(View.INVISIBLE);
tianjia1.setVisibility(View.INVISIBLE);
xiugai1.setVisibility(View.INVISIBLE);
shanchu1.setVisibility(View.INVISIBLE);
chaxun1.setVisibility(View.INVISIBLE);
*客户信息按钮监听
publicvoidonkehu(Viewv){
tianjia2.setVisibility(View.VISIBLE);
xiugai2.setVisibility(View.VISIBLE);
shanchu2.setVisibility(View.VISIBLE);
chaxun2.setVisibility(View.VISIBLE);
tianjia3.setVisibility(View.INVISIBLE);
xiugai3.setVisibility(View.INVISIBLE);
shanchu3.setVisibility(View.INVISIBLE);
chaxun3.setVisibility(View.INVISIBLE);
*商品入库信息按钮监听
publicvoidonruku(Viewv){
tianjia4.setVisibility(View.VISIBLE);
xiugai4.setVisibility(View.VISIBLE);
shanchu4.setVisibility(View.VISIBLE);
chaxun4.setVisibility(View.VISIBLE);
tianjia5.setVisibility(View.INVISIBLE);
xiugai5.setVisibility(View.INVISIBLE);
shanchu5.setVisibility(View.INVISIBLE);
chaxun5.setVisibility(View.INVISIBLE);
*添加出库按钮监听
publicvoidtianjiac(Viewv){
Intentintent=newIntent();
Bundlebundle=newBundle();
bundle.putString("username",names);
intent.putExtras(bundle);
intent.setClass(getApplicationContext(),Tianjiac.class);
startActivity(intent);
*用户管理按钮监听
publicvoidyonghu(Viewv){
intent.setClass(getApplicationContext(),Yonghu.class);
publicvoidkucun(Viewv){
intent.setClass(MenuDemo.this,Kucun.class);
通过本次课程设计,我们掌握了Android系统的基本概念、相关原理和技术,结合实际的操作和设计,巩固了课堂教学的内容,将理论与实际相结合,应用现有的Eclipse软件,初步完成了一个小型药品WMS仓库管理系统的设计与实现,在设计期间,实践操作Android开发技术的相关知识,更加扎实掌握基础知识。
六、
参考文献
1
3公磊周聪.基于Android的移动终端应用程序开发与研究[J].计算机与现代化,2008(8)
4王向辉沈洁.Android应用程序开发[M].清华大学出版社,2010.3
下载文档到电脑,查找使用更方便
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
copyright@ 2008-2022 冰点文档网站版权所有
经营许可证编号:鄂ICP备2022015515号-1