Android学生信息管理系统APPWord文档格式.docx
《Android学生信息管理系统APPWord文档格式.docx》由会员分享,可在线阅读,更多相关《Android学生信息管理系统APPWord文档格式.docx(18页珍藏版)》请在冰豆网上搜索。
professionTEXT,
ageTEXT
)
4、具体实现
1.主界面:
主界面显示所有功能,每个按钮点击后,跳转进入相应功能
核心代码:
publicclassMainextendsActivity{
SQLiteDatabasedb;
Buttonbtn_search;
Buttonbtn_modify;
Buttonbtn_add;
Buttonbtn_delete;
Buttonbtn_quit;
Buttonbtn_show;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
requestWindowFeature;
getWindow().setFlags
(savedInstanceState);
setContentViewoString()+"
/"
null);
btn_search=(Button)findViewByIdbtn_modify=(Button)findViewByIdbtn_add=(Button)findViewByIdbtn_delete=(Button)findViewByIdbtn_quit=(Button)findViewByIdbtn_show=(Button)findViewById
try
{
Cursorcursor=("
select*fromstudent"
();
}
catch(SQLiteExceptione)
("
createtablestudent"
+"
("
nameTEXT,"
NOTEXTPrimaryKey,"
sexTEXT,"
professionTEXT,"
ageTEXT"
)"
);
how();
}
else
{
List<
Student>
p=newArrayList<
();
String>
re_name=newArrayList<
String[]>
info=newArrayList<
etFlagsetExtras().get("
data"
String[]people=(String[])("
name"
String[][]data=;
publicObjectgetChild(intgroupPosition,intchildPosition)
{
returndata[groupPosition][childPosition];
}
publiclonggetChildId(intgroupPosition,intchildPosition)
returnchildPosition;
publicintgetChildrenCount(intgroupPosition)
returndata[groupPosition].length;
oString());
returntextView;
publicObjectgetGroup(intgroupPosition)
returnpeople[groupPosition];
publicintgetGroupCount()
return;
publiclonggetGroupId(intgroupPosition)
returngroupPosition;
(textView);
returnll;
};
ExpandableListViewexpandListView=(ExpandableListView)findViewById(adapter);
}
}
3.增添数据界面:
根据文本框输入内容进行数据的插入,且具有完整性和重复性的判断,插入成功失败均会产生提示
publicclassAddextendsActivity{
Buttonbtn_Accept;
Buttonbtn_Cancle;
TextViewET_name;
TextViewET_NO;
TextViewET_Pro;
TextViewET_Age;
RadioGrouprg;
Stringradio_sex="
男"
;
setContentView
db=().toString()+"
null,;
btn_Accept=(Button)findViewByIdbtn_Cancle=(Button)findViewById
ET_name=(TextView)findViewByIdET_NO=(TextView)findViewByIdET_Pro=(TextView)findViewByIdET_Age=(TextView)findViewById
rg=(RadioGroup)findViewById
(newOnCheckedChangeListener(){
publicvoidonCheckedChanged(RadioGroupgroup,intCheckedId){
radio_sex=CheckedId=="
:
"
女"
});
oString();
StringNO=().toString();
Stringsex=radio_sex;
Stringpro=().toString();
Stringage=().toString();
how();
return;
"
成功插入一条数据:
"
+"
\n"
+name+"
+NO+"
+sex+"
+pro+"
+age,.show();
(newOnClickListener()
publicvoidonClick(Viewsource){
();
finish();
4.修改数据界面:
查找界面:
对文本框内输入的数据进行精确查找,成功后转入修改界面
修改界面:
文本框内默认显示之前的数据,修改完成点击确定以文本框内的信息对数据进行更新
查找:
(newOnClickListener()
Stringname=().toString();
Cursorcursor=("
select*fromstudentwhere"
+"
name="
andNO="
newString[]{name,NO});
{
Stringmem_name=null;
Stringmem_No=null;
Stringmem_profession=null;
Stringmem_sex=null;
Stringmem_age=null;
oString()+"
btn_accept=(Button)findViewByIdbtn_cancle=(Button)findViewById
TextView_ModifyResult_No=(TextView)findViewByIdET_ModifyResult_Name=(EditText)findViewByIdET_ModifyResult_pro=(EditText)findViewByIdET_ModifyResult_age=(EditText)findViewByIdrg=(RadioGroup)findViewByIdoString();
Stringnew_profession=().toString();
Stringnew_age=().toString();
Stringnew_sex=radio_sex;
更新数据成功"
.show();
5.查找数据界面:
对文本框内的数据进行模糊查询,查询成功则跳转只查询结果界面,查询失败则产生相应提示
publicclassSearchextendsActivity{
EditTextET_name;
EditTextET_NO;
ET_name=(EditText)findViewByIdET_NO=(EditText)findViewById
"
成功"
oString();
try
{
("
deletefromstudent"
+"
wherename="
newString[]{name,NO});
}
how();
return;
();
finish();
//取消按钮点击后的监听事件
附:
student类的定义
publicclassStudentimplementsSerializable
{
privatestaticfinallongserialVersionUID=1L;
publicStringname;
publicStringNO;
publicStringsex;
publicStringprofession;
publicStringage;
publicString[]MakeString()
{
String[]s={name,NO,sex,profession,age};
returns;
publicString[][]info;
5、总结
这个安卓app实现了对数据库操作的基本功能,使用起来简便性强,轻便直接,因为是可视化编程,所以对于界面也进行了一定程度的美化,对应的编写平台是手机,所以实现的功能都是以简单实用美观为基础,并且同时保证健壮性为目标,但是同样因为这个原因在查询功能上,功能比较简单,比如查询操作,只能在满足基本的查询功能上添加简易的模糊查询,并且查找条件比较单一,因此,仍然可以在此方面做出改进
计算机科学与技术学院课程设计成绩单
课程名称:
数据库系统原理课程设计
姓名
詹博策
性别
男
学号
7055
班级
DB1302
电话
综合成绩
成绩等级
程序运行情况
(占总成绩20%)
□能正确运行□基本能正确运行□能运行但结果不完善
(20分)(15分)(10分)
程序功能完善程度
(占总成绩10%)
□完善□基本完善□不完善
(10分)(8分)(5分)
程序结构的合理性
□合理□基本合理□不太合理
对问题的答辩情况
(占总成绩40%)
□概念正确有创新(40分)
□能正确回答所有问题(35分)
□基本能正确回答(30分)
□部分问题回答概念不清晰(20分)
学生的工作态度与独立工作能力
□工作态度认真能独立完成任务(10分)
□工作态度基本认真,独立性尚可(8分)
□工作态度和独立性较差(5分)
设计报告的规范性
□符合规范□基本符合规范□规范性较差
A:
90~100分A-:
85~89分B+:
82~84分B:
78~81分B-:
75~77分
C+:
72~74分C:
68~71分C-:
64~67分D:
60~63分F:
<
60分
武汉科技大学计算机科学与技术学院制表