Android第四次做業

Android期末大做業

1、在本次博客開頭寫出團隊全部成員的姓名、學號、班級及博客連接地址android

  姓名:田光欣     學號:1600802061  班級:計算機162班   git

 博客連接:https://edu.cnblogs.com/campus/qhu/16Androidgithub

2、很是重要給出團隊項目的apk連接,必須是可運行的一個apk,不然本次做業爲0分數據庫

   apk連接:https://git.coding.net/tian-xin/DiaryProject.gitjson

3、給出本次做業代碼的連接,項目完整代碼(2分)服務器

    項目連接:https://git.coding.net/tian-xin/DiaryProject.gitide

    視頻連接:https://pan.baidu.com/s/1KbBVAlwWtDGIVs1ty5dKDQ學習

4、介紹團隊項目ui

1.團隊項目的整體效果截圖(4分)this

(1)查看用戶編輯的全部筆記:

(2用戶編輯一條新的筆記:

(3)刪除筆記:

(4)對用戶編輯好的筆記進行修改:

(5)退出系統:

 

 

2.實現的功能及其效果的描述(6分)

(1)顯示編輯筆記的標題以及建立的具體時間;

(2)查看某一條筆記內容並對其進行修改;

(3)添加筆記;

(4)刪除筆記;

(5)退出系統;

5、項目關鍵代碼

 

1.主界面設計

 

<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"
android:background="@drawable/bk"
tools:context=".MainActivity" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:background="#FD8A0D"
android:text="+"
android:textColor="#FFFFFF"
android:textSize="85px" />

<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp" >
</ListView>

</RelativeLayout>

 2.用戶進行筆記編輯時的界面:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bk" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:paddingLeft="10dp"
        android:paddingTop="10dp"
        android:text="主題"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView2"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/textView1"
        android:layout_marginRight="10dp"
        android:ems="10"
        android:paddingBottom="3dp"
        android:paddingLeft="5dp"
        android:paddingTop="3dp" >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/editText2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/button1"
        android:layout_alignLeft="@+id/textView2"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/textView2"
        android:layout_marginBottom="5dp"
        android:layout_marginRight="10dp"
        android:ems="10"
        android:gravity="top"
        android:paddingLeft="5dp"
        android:paddingRight="10dp"
        android:paddingTop="3dp" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/textView1"
        android:layout_below="@+id/editText1"
        android:text="內容"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/editText2"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@+id/editText2"
        android:layout_marginBottom="5dp"
        android:background="#FD8A0D"
        android:paddingRight="10dp"
        android:text="保存"
        android:textColor="#FFFFFF" />

</RelativeLayout>

 3.建立數據庫數據表用於對用戶的筆記標題、內容和建立時間進行保存;

 
 
public class MyOpenHelper extends SQLiteOpenHelper{
public MyOpenHelper(Context context) {
// 建立數據庫
super(context, "mydate", null, 1);
// TODO Auto-generated constructor stub
}

@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
//建立數據表

db.execSQL("create table mybook(ids integer PRIMARY KEY autoincrement,title text,content text,times text)");
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub

}


}
 

 4.筆記的添加

 
public void toInsert(Book book){
myDatabase=myHelper.getWritableDatabase();
myDatabase.execSQL("insert into mybook(title,content,times)values('"+ book.getTitle()+"','"+book.getContent()+"','"+book.getTimes()+"')");
myDatabase.close();
}

 5.筆記的修改:

public void toUpdate(Book book){
        myDatabase=myHelper.getWritableDatabase();
        myDatabase.execSQL("update mybook set title='"+ book.getTitle()+"',times='"+book.getTimes()+"',content='"+book.getContent() +"' where ids='"+ book.getIds()+"'");
        myDatabase.close();
    }

6.筆記的刪除:

 
public void toDelete(int ids){
myDatabase=myHelper.getWritableDatabase();
myDatabase.execSQL("delete from mybook where ids="+ids+"");
myDatabase.close();
}

7.長按判斷是否刪除

lv.setOnItemLongClickListener(new OnItemLongClickListener() {

@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
final int position, long id) {
// TODO Auto-generated method stub
new AlertDialog.Builder(MainActivity.this)
.setTitle("你肯定要刪除嗎?")
.setPositiveButton("肯定", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
mdb.toDelete(array.get(position).getIds());
array=mdb.getArray();
MyAdapter adapter=new MyAdapter(inflater,array);
lv.setAdapter(adapter);
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub

}
})

.create().show();
return true;
}
});
 

 8.mean裏的新建筆記事件

 
bt.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent=new Intent(getApplicationContext(),SecondAtivity.class);
startActivity(intent);
MainActivity.this.finish();
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

 9.meanl裏的退出事件

 
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
case R.id.item1:
Intent intent=new Intent(getApplicationContext(),SecondAtivity.class);
startActivity(intent);
this.finish();
break;
case R.id.item2:
this.finish();
break;
default:
break;
}
return true;

}

 

6、運行其餘團隊項目的apk,團隊討論,選出你心目中的前5名,並簡單說明一下(項目的優勢及不足之處,每一個項目評語很多於150字)(10分)

第一名:湯文濤、楊聖豪、黃東強組——校園二手交易

項目整體評價:該項目實現了完整的從登錄註冊,到在校園二手平臺上發佈閒置,對商品進行預覽留言評論的整個完整過程,項目界面簡潔友好美觀,用戶體驗度好。

詳細說明:(1)界面簡潔優美觀。他們組寫的「校園二手交易App」無論是登錄界面,註冊界面仍是商品預覽界面、仍是用戶評價界面都作的很是的簡潔美觀,沒有太過複雜,使得用戶比較容易接受;

                  (2)實現了整個項目的全部功能。「校園二手交易App」項目實現了用戶登陸、註冊、商品預覽以及用戶評價留言的全部功能;

                  (3)他們小組分工明確。能在短短兩週時間內作出如此優秀的項目,離不開他們小組每一個人的努力,更離不開小組成員的明確分工;

第二名:沈順文組——代碼殺

項目整體評價:「代碼殺」項目:界面友好,內容豐富、功能強大的優秀的項目。

詳細說明:(1)界面友好."代碼殺"項目全部的界面都很是的美觀;

                  (2)內容豐富。「代碼殺」項目中充分運用了在Android課程中學到的知識;

                  (3)功能強大。「代碼殺」項目首先實現了用戶登陸註冊,在用戶登陸成功後用戶能夠設置本身的信息,用戶能夠選擇「代碼闖關」、「代碼搜索」、「代碼學習」、「代碼交流」四個模塊中的一個。這四個模塊的具體功能也作得很是的好;

                 (4)實用性強。「代碼殺APP」很是的實用;

                 (5)「代碼殺」項目由沈順文同窗本身獨立完成;

第三名:劉宇瑩、孟鑫菲組——電子拍賣

項目整體評價:本項目分爲服務器端和安卓端,安卓端主要負責向服務器請求數據和處理服務器相應的json數據,服務器端負責處理安卓端請求以及和數據庫交互並把交互數據封裝成json數據返回給安卓端。項目很是的使用。

詳細說明:(1)項目實現的功能很是的強大,項目實現了用戶的登陸、註冊、查看全部物品種類、查看用戶競拍的物品、查看用戶的拍賣物品,添加用戶拍賣物品等功能;

                  (2)界面美觀。「電子拍賣App」全部的界面都很是的漂亮,能夠看出這些全部界面都是用心設計的,包括在界面中用到的全部圖片等素材也都是她們組認真查找的;

                  (3)在項目中設計了服務器端和安卓端。這是本項目最大的亮點;

第四名:馬秀蓮、馬玉花組——快遞項目

項目整體描述:這個項目內容特別豐富、功能強大、實用性特別強;

詳細說明:(1)內容豐富、功能強大。該項目中設計了用戶登陸、註冊功能。用戶在用戶登陸成功後,能夠看到關於圓通、韻達、中通、申通快遞的相關信息。同時用戶可發佈留言信息,能夠找人代取快遞、用戶能夠添加好友,顯示添加的好友列表;

                (2)實用性強。這款App適用與全部的在校的師生;

第五名:蘇毅俊、南加拉才讓、周澤加、李長棟組

項目整體評價:實用、很注重細節、功能實現比較完整;

詳細說明:(1)實用、功能強大。這款App很是的實用,用這款App能夠進行點名,查看學生用戶信息、發佈公告;用這款App進行點名簽到節省了老師和學生的時間,同時也很是的方便快捷,老師能夠查看學生的詳細信息,老師也能夠發佈公告;

                 (2)很注重細節。老師再點名的啥時候能夠進行順序點名或者進行隨機點名。在進行學生信息查詢的時候能夠查看該學生的遲到次數可曠課次數;

                 (3)從小組分工以及團隊最後的項目就,能夠看出他們小組的分工很明確;

7、寫出團隊全部成員作項目中遇到的問題,以及解決方法

 這個項目在製做過程當中遇到了不少的困難,(1)長按刪除,經過跟同窗詢問解決;(2)在編輯筆記時記住當時的時間;經過查閱資料解決。

8、說明團隊成員在本次項目中的分工、佔了總工做的多少?以及對項目成員打分(滿分10分) (4分)

姓名 分工 工做比例 分數(10分)
田光欣 數據庫,UI,代碼 100% 10
相關文章
相關標籤/搜索