最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

安卓期末大作業(yè)——日記APP

2022-12-14 23:22 作者:考研保研直通車  | 我要投稿

通達學院

2022/2023 學年 第 一 學期

課程設(shè)計 實驗報告


模 塊 名 稱 Android課程設(shè)計

專 業(yè) 通信工程(嵌入式培養(yǎng))

學 生 班 級

學 生 學 號

學 生 姓 名

指 導 教 師

目 錄一、熟悉Android開發(fā)環(huán)境安裝與配置11、 基本要求12、 安裝與配置過程13、 調(diào)試過程及結(jié)果分析14、 體會1二、練習題目:xxx21、 設(shè)計22、 實現(xiàn)方法23、 調(diào)試過程及結(jié)果分析24、 體會2三、綜合應用:xxx31、設(shè)計內(nèi)容及要求32、需求分析32.1 xxx分析32.2 xxx分析32.3xxx分析33、總體設(shè)計33.1 xxx設(shè)計33.2 xxx設(shè)計44、詳細設(shè)計44.1 xxx44.2 xxx44.3 xxx45、實驗結(jié)果及分析46、體會和建議4設(shè)計成績評定5

一、熟悉Android開發(fā)環(huán)境安裝與配置

  1. 基本要求

  2. 配置Android的開發(fā)環(huán)境,可以實現(xiàn)一個完整工程的構(gòu)建;可以構(gòu)建常用Android工程;
    2)熟悉Android sdk的管理插件,安裝并生成仿真器;
    3)充分理解Android工程文件的目錄結(jié)構(gòu);

  3. 安裝與配置過程
    先安裝好JDK,然后運行Android studio安裝程序


一旦啟動 Android Studio 安裝,需要在 Android Studio 安裝器中設(shè)置 JDK5 或以后版本路徑。


以下圖片為 Android SDK 初始化 JDK


檢查創(chuàng)建應用程序所需的組件,下圖選中了 "Android Studio", "Android SDK", "Android 虛擬機"和"外觀(Intel chip)"。


需要指定本機上的 Android Studio 和 Android SDK 的路徑。下圖展示了在 windows 8.1 64位架構(gòu)上的默認安裝位置。


指定 Android 模擬器默認需要的 ram 空間為512M。


最后,解壓 SDK 軟件包到本地機器,這將持續(xù)一段時間并占用2626M 的硬盤空間。
完成上面的步驟,將看到結(jié)束按鈕,并可以在歡迎界面中打開 Android Studio 項目,如下圖:

  1. 調(diào)試過程及結(jié)果分析
    Android的SDK環(huán)境安裝完成后,就可以在SDK中建立工程并進行調(diào)試了。建立Android工程步驟如下:
    通過調(diào)用開始新的 Android Studio 項目來開始 Android 應用程序開發(fā)。在新的安裝頁面,要求填寫應用程序名稱,包名信息和項目路徑。


輸入應用程序名稱之后,開始選擇應用程序運行的環(huán)境參數(shù),這里需要指定最小 SDK。這個教程中,我們選擇 API 21: Android 5.0(Lollipop)


安裝的下一步需要選擇移動設(shè)備的活動,為應用程序指定默認布局。


最后階段打開開發(fā)工具來編寫應用程序代碼。


為了測試 Android 應用程序需要Android虛擬設(shè)備。因此在開始寫代碼之前,來創(chuàng)建一個 Android 虛擬設(shè)備。點擊下圖中的 AVD Manager 圖標來啟動 Android AVD 管理器。


點擊虛擬設(shè)備圖標之后,將顯示 SDK 中已有的默認虛擬設(shè)備。點擊 "Create new Virtual device" 按鈕來創(chuàng)建虛擬設(shè)備。


如果 AVD 創(chuàng)建成功,這意味著已經(jīng)準備好 Android 應用程序開發(fā)。點擊右上角的關(guān)閉按鈕來關(guān)閉窗口。在完成最后一個步驟后,最后重啟你的機器。在開始第一個 Android 示例之前,需要先了解一些 Android 應用程序開發(fā)相關(guān)的概念。
Hello World 實例
在編寫 Hello World 代碼之前,我們需要知道 XML 標簽。按照 app > res > layout > activity_main.xml,打開文件。


具體代碼如下:
<RelativeLayout xmlns:android="schemas.android.com/apk"
xmlns:tools="schemas.android.com/too" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world"
android:layout_width="550dp"
android:layout_height="wrap_content" /></RelativeLayout>
點擊 Run > Run App 運行程序,運行結(jié)果如下:

  1. 體會

Android Studio以IntelliJ IDEA為基礎(chǔ),旨在取代Eclipse和ADT(Android開發(fā)者工具)為開發(fā)者提供更好的開發(fā)工具人稱“親生”的android開發(fā)IDE,本人使用了一段時間之后,發(fā)現(xiàn)功能真是強大,完爆eclipse等開發(fā)工具,最大的亮點就是【代碼提示】和【實時預覽布局】這兩塊。官網(wǎng)上介紹說,Android Studio有諸多好處:基于Gradle的構(gòu)建支持、Android特定重構(gòu)和快速修復、更加豐富的模板代碼,讓創(chuàng)建程序更加簡單;更好的提示工具,對程序性能、可用性、版本兼容和其他的問題進行捕捉控制、直接支持ProGuard和應用程序簽名功能、自帶布局編輯器,可以拖放UI組件,可以在不同的配置的屏幕上預覽布局、內(nèi)置google云服務、內(nèi)置svn,git工具、支持插件安裝。總而言之,這是google自家出的IDE,肯定對android開發(fā)的支持是極好的。

二、練習題目:圖表

  1. 設(shè)計

  1. 實現(xiàn)方法

闡釋通過Github開源的mpandroidchart來實現(xiàn)支持橫向滾動的柱狀圖表。步驟如下:

  1. 添加依賴

  1. 在布局文件添加控件

  1. 在MainActivity實現(xiàn)柱狀圖繪制,代碼如下

package com.example.chart;

import androidx.annotation.ColorRes;

import androidx.annotation.Nullable;

import androidx.appcompat.app.AppCompatActivity;

import androidx.core.content.ContextCompat;

import android.graphics.Color;

import android.os.Bundle;

import com.github.mikephil.charting.charts.BarChart;

import com.github.mikephil.charting.components.AxisBase;

import com.github.mikephil.charting.components.Description;

import com.github.mikephil.charting.components.Legend;

import com.github.mikephil.charting.components.LimitLine;

import com.github.mikephil.charting.components.XAxis;

import com.github.mikephil.charting.components.YAxis;

import com.github.mikephil.charting.data.BarData;

import com.github.mikephil.charting.data.BarDataSet;

import com.github.mikephil.charting.data.BarEntry;

import com.github.mikephil.charting.formatter.IAxisValueFormatter;

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;

import java.util.ArrayList;

import java.util.Arrays;

import java.util.LinkedHashMap;

import java.util.List;

public class MainActivity extends AppCompatActivity {

private BarChart barChart;

private YAxis leftAxis; //左側(cè)Y軸

private YAxis rightAxis; //右側(cè)Y軸

private XAxis xAxis; //X軸

private Legend legend; //圖例

private LimitLine limitLine; //限制線

@Override

protected void onCreate(@Nullable Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

barChart = findViewById(R.id.bar_chart);

initBarChart(barChart);

//處理數(shù)據(jù)是 記得判斷每條柱狀圖對應的數(shù)據(jù)集合 長度是否一致

LinkedHashMap<String, List<Float>> chartDataMap = new LinkedHashMap<>();

List<String> xValues = new ArrayList<>();

List<Float> yValue1 = new ArrayList<>();

List<Float> yValue2 = new ArrayList<>();

List<Integer> colors = Arrays.asList(

ContextCompat.getColor(this,R.color.purple_500),getResources().getColor(R.color.teal_700)

);

xValues.add("蔬菜");

xValues.add("肉類");

xValues.add("牛奶");

xValues.add("水果");

xValues.add("零食");

xValues.add("飲料");

xValues.add("蔬菜2");

xValues.add("肉類2");

xValues.add("牛奶2");

yValue1.add((float)4.0);

yValue2.add((float)1.9);

yValue1.add((float)6.4);

yValue2.add((float)0.9);

yValue1.add((float)8.4);

yValue2.add((float)4.9);

yValue1.add((float)4.4);

yValue2.add((float)1.9);

yValue1.add((float)6.4);

yValue2.add((float)0.9);

yValue1.add((float)8.4);

yValue2.add((float)4.9);

yValue1.add((float)4.4);

yValue2.add((float)1.9);

yValue1.add((float)6.4);

yValue2.add((float)0.9);

yValue1.add((float)8.4);

yValue2.add((float)4.9);

chartDataMap.put("標準值", yValue1);

chartDataMap.put("實際值", yValue2);

showBarChart(xValues, chartDataMap, colors);

//請求數(shù)據(jù)變化時刷新

barChart.invalidate();

}

/**

* 初始化BarChart圖表

*/

private void initBarChart(BarChart barChart) {

/***圖表設(shè)置***/

//背景顏色

barChart.setBackgroundColor(Color.WHITE);

//不顯示圖表網(wǎng)格

barChart.setDrawGridBackground(false);

//背景陰影

barChart.setDrawBarShadow(false);

barChart.setHighlightFullBarEnabled(false);

barChart.setDoubleTapToZoomEnabled(false);

//支持左右滑動

barChart.setDragEnabled(true);

//X軸或Y軸禁止縮放

barChart.setScaleXEnabled(false);

barChart.setScaleYEnabled(false);

barChart.setScaleEnabled(false);

//不顯示邊框

barChart.setDrawBorders(false);

//不顯示右下角描述內(nèi)容

Description description = new Description();

description.setEnabled(false);

barChart.setDescription(description);

/***XY軸的設(shè)置***/

//X軸設(shè)置顯示位置在底部

xAxis = barChart.getXAxis();

xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);

xAxis.setGranularity(1f);

leftAxis = barChart.getAxisLeft();

rightAxis = barChart.getAxisRight();

//不繪制 Y軸線條

rightAxis.setDrawAxisLine(false);

//不顯示X軸網(wǎng)格線

xAxis.setDrawGridLines(false);

leftAxis.setDrawGridLines(false);

rightAxis.setDrawGridLines(false);

/***折線圖例 標簽 設(shè)置***/

legend = barChart.getLegend();

legend.setForm(Legend.LegendForm.SQUARE);

legend.setTextSize(11f);

//顯示位置

legend.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);

legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);

legend.setOrientation(Legend.LegendOrientation.HORIZONTAL);

//是否繪制在圖表里面

legend.setDrawInside(false);

}

/**

* 柱狀圖始化設(shè)置 一個BarDataSet 代表一列柱狀圖

*

* @param barDataSet 柱狀圖

* @param color 柱狀圖顏色

*/

private void initBarDataSet(BarDataSet barDataSet, int color) {

barDataSet.setColor(color);

barDataSet.setFormLineWidth(1f);

barDataSet.setFormSize(15.f);

}

/**

* @param xValues X軸的值

* @param dataLists LinkedHashMap<String, List<Float>>

* key對應柱狀圖名字 List<Float> 對應每類柱狀圖的Y值

* @param colors

*/

public void showBarChart(final List<String> xValues, LinkedHashMap<String, List<Float>> dataLists,

@ColorRes List<Integer> colors) {

List<IBarDataSet> dataSets = new ArrayList<>();

int currentPosition = 0;//用于柱狀圖顏色集合的index

for (LinkedHashMap.Entry<String, List<Float>> entry : dataLists.entrySet()) {

String name = entry.getKey();

List<Float> yValueList = entry.getValue();

List<BarEntry> entries = new ArrayList<>();

for (int i = 0; i < yValueList.size(); i++) {

/**

* 如果需要添加TAG標志 可使用以下構(gòu)造方法

* BarEntry(float x, float y, Object data)

* e.getData()

*/

entries.add(new BarEntry(i, yValueList.get(i)));

}

// 每一個BarDataSet代表一類柱狀圖

BarDataSet barDataSet = new BarDataSet(entries, name);

initBarDataSet(barDataSet, colors.get(currentPosition));

dataSets.add(barDataSet);

currentPosition++;

}

//X軸自定義值

xAxis.setValueFormatter(new IAxisValueFormatter() {

@Override

public String getFormattedValue(float value, AxisBase axis) {

return xValues.get((int) Math.abs(value) % xValues.size());

}

});

xAxis.setLabelRotationAngle(-60);//x軸文字斜體顯示

rightAxis.setValueFormatter(new IAxisValueFormatter() {

@Override

public String getFormattedValue(float value, AxisBase axis) {

return "";

}

});

BarData data = new BarData(dataSets);

/**

* float groupSpace = 0.3f; //柱狀圖組之間的間距

* float barSpace = 0.05f; //每條柱狀圖之間的間距 一組兩個柱狀圖

* float barWidth = 0.3f; //每條柱狀圖的寬度 一組兩個柱狀圖

* (barWidth + barSpace) * 2 + groupSpace = (0.3 + 0.05) * 2 + 0.3 = 1.00

* 3個數(shù)值 加起來 必須等于 1 即100% 按照百分比來計算 組間距 柱狀圖間距 柱狀圖寬度

*/

int barAmount = dataLists.size(); //需要顯示柱狀圖的類別 數(shù)量

//設(shè)置組間距占比30% 每條柱狀圖寬度占比 70% /barAmount 柱狀圖間距占比 0%

float groupSpace = 0.3f; //柱狀圖組之間的間距

float barWidth = (1f - groupSpace) / barAmount;

float barSpace = 0f;

//設(shè)置柱狀圖寬度

data.setBarWidth(barWidth);

//(起始點、柱狀圖組間距、柱狀圖之間間距)

data.groupBars(0f, groupSpace, barSpace);

barChart.setData(data);

//設(shè)置柱狀圖一頁顯示的范圍(0-5)

barChart.setVisibleXRange(0,5);

//解決x軸標簽斜體顯示不全的問題

barChart.notifyDataSetChanged();

xAxis.setAxisMinimum(0f);

xAxis.setAxisMaximum(xValues.size());

//將X軸的值顯示在中央

xAxis.setCenterAxisLabels(true);

}

}

  1. 調(diào)試過程及結(jié)果分析
    調(diào)試結(jié)果如下:

  1. 體會

通過本次實操學會了barChart柱狀圖圖表的繪制,學會如何設(shè)置橫軸和縱軸的刻度及名稱,并解決了x軸標簽斜體顯示不全的問題。

三、綜合應用:日記本

  1. 設(shè)計內(nèi)容及要求
    設(shè)計要求:設(shè)計開發(fā)基于Android的日記本軟件,日記支持輸入文字和插入圖片,且能夠?qū)崿F(xiàn)日記的增刪改功能。

  2. 需求分析
    2.1 功能分析
    要具備注冊和登錄功能、注冊登錄之后才可以寫日記,并將日記保存到相應的用戶數(shù)據(jù)里。
    2.2 用例分析
    2.2.1 用戶


2.2.2 日記

  1. 總體設(shè)計
    3.1 注冊登錄頁面設(shè)計
    3.1.1注冊頁面設(shè)計


圖3-1 注冊頁面布局圖
3.1.2?登錄頁面設(shè)計

圖3-2 登錄頁面布局圖
3.2 日記列表和詳情頁設(shè)計
3.2.1 日記列表頁設(shè)計

圖3-3 日記列表頁布局圖
3.2.2日記詳情頁設(shè)計

圖3-4 日記詳情頁、頁布局圖

  1. 詳細設(shè)計
    4.1 注冊功能實現(xiàn)關(guān)鍵代碼
    //5 注冊按鈕功能的實現(xiàn)--------------------代碼
    private void btnRegister() {
    btn_register.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    //創(chuàng)建一個對象,用來封裝一行數(shù)據(jù)
    ContentValues values=new ContentValues();
    values.put("name",et_name.getText().toString());//將輸入的用戶名放到 name 列
    values.put("pwd",et_pwd.getText().toString());//將輸入的密碼放到 pwd 列
    values.put("email",et_email.getText().toString());//將輸入的郵箱放到 email 列
    values.put("phone",et_phone.getText().toString());//將輸入的電話放到 phone 列
    //將封裝好的一行數(shù)據(jù)保存到數(shù)據(jù)庫的 tb_userinfo 表中
    db.insert("tb_userinfo",null,values);
    Toast.makeText(RegisterActivity.this,"注冊成功",Toast.LENGTH_SHORT).show();
    }
    });
    }
    4.2 登錄功能實現(xiàn)關(guān)鍵代碼
    //3 登錄按鈕功能的實現(xiàn)---------------------------代碼
    private void btnLogin() {
    btn_login.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    //首先:獲取輸入的用戶名和密碼
    String inputname=et_name.getText().toString();
    String inputpwd=et_pwd.getText().toString();
    //其次:對獲取的用戶名和密碼進行判斷
    if(inputname.equals("")||inputpwd.equals("")){//用戶名或密碼為空
    Toast.makeText(LoginActivity.this,"用戶名或密碼不能為空",Toast.LENGTH_SHORT).show();
    }else{//用戶名或密碼不為空時,我們再對輸入的正確性進行判斷。
    // 根據(jù)輸入的用戶名和密碼從數(shù)據(jù)庫中查詢
    Cursor cursor =db.rawQuery("select * from tb_userinfo where name=? and pwd=?",new String[]{inputname,inputpwd});
    //根據(jù)查詢到的結(jié)果進行判斷
    if (cursor.moveToNext()){//查詢到時
    @SuppressLint("Range") String getname=cursor.getString(cursor.getColumnIndex("name"));
    @SuppressLint("Range") String getpwd=cursor.getString(cursor.getColumnIndex("pwd"));
    if(inputname.equalsIgnoreCase(getname)&&inputpwd.equalsIgnoreCase(getpwd)){
    SharedPreferences.Editor editor=getSharedPreferences("userinfo",0).edit();
    editor.putString("username",inputname);
    editor.putString("userpwd",inputpwd);
    editor.commit();
    Toast.makeText(LoginActivity.this,"用戶名和密碼正確,歡迎登陸",Toast.LENGTH_SHORT).show();
    Intent intent=new Intent(LoginActivity.this, MainActivity.class);
    startActivity(intent);
    finish();
    }
    }else{//沒有查詢到結(jié)果時
    Toast.makeText(LoginActivity.this,"用戶名或密碼錯誤,請重新輸入",Toast.LENGTH_SHORT).show();
    et_name.setText("");
    et_pwd.setText("");
    }
    }
    }
    });
    }
    。。。
    4.3 日記列表頁功能實現(xiàn)關(guān)鍵代碼
    private void initView() {
    Toolbar toolbar = findViewById(R.id.toolbar_main);
    setSupportActionBar(toolbar);
    ActivityCompat.requestPermissions(this, permissions, 321);
    noteDao = new NoteDao(this);
    RecyclerView rv_list_main = findViewById(R.id.rv_list_main);
    rv_list_main.addItemDecoration(new SpacesItemDecoration(0));//設(shè)置item間距
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);//豎向列表
    rv_list_main.setLayoutManager(layoutManager);
    mNoteListAdapter = new MyNoteListAdapter();
    mNoteListAdapter.setmNotes(noteList);
    rv_list_main.setAdapter(mNoteListAdapter);
    mNoteListAdapter.setOnItemClickListener(new MyNoteListAdapter.OnRecyclerViewItemClickListener() {
    @Override
    public void onItemClick(View view, Note note) {
    Intent intent = new Intent(MainActivity.this, NoteActivity.class);
    Bundle bundle = new Bundle();
    bundle.putSerializable("note", note);
    intent.putExtra("data", bundle);
    startActivity(intent);
    }
    });
    mNoteListAdapter.setOnItemLongClickListener(new MyNoteListAdapter.OnRecyclerViewItemLongClickListener() {
    @Override
    public void onItemLongClick(View view, final Note note) {
    AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
    builder.setTitle("提示");
    builder.setMessage("確定刪除日記?");
    builder.setCancelable(false);
    builder.setPositiveButton("確定", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
    int ret = noteDao.deleteNote(note.getId());
    if (ret > 0) {
    showToast("刪除成功");
    //TODO 刪除日記成功后,記得刪除圖片(分為本地圖片和網(wǎng)絡(luò)圖片)
    //獲取日記中圖片的列表 StringUtils.getTextFromHtml(note.getContent(), true);
    refreshNoteList();
    }
    }
    });
    builder.setNegativeButton("取消", null);
    builder.create().show();
    }
    });
    }
    4.4 寫日記功能實現(xiàn)關(guān)鍵代碼
    try {
    Intent intent = getIntent();
    flag = intent.getIntExtra("flag", 0);//0新建,1編輯
    if (flag == 1) {//編輯
    setTitle("編輯日記");
    Bundle bundle = intent.getBundleExtra("data");
    note = (Note) bundle.getSerializable("note");
    if (note != null) {
    myTitle = note.getTitle();
    myContent = note.getContent();
    myNoteTime = note.getCreateTime();
    Group group = groupDao.queryGroupById(note.getGroupId());
    if (group != null) {
    myGroupName = group.getName();
    tv_new_group.setText(myGroupName);
    }
    loadingDialog = new ProgressDialog(this);
    loadingDialog.setMessage("數(shù)據(jù)加載中...");
    loadingDialog.setCanceledOnTouchOutside(false);
    loadingDialog.show();
    tv_new_time.setText(note.getCreateTime());
    et_new_title.setText(note.getTitle());
    et_new_content.post(new Runnable() {
    @Override
    public void run() {
    dealWithContent();
    }
    });
    }
    } else {
    setTitle("新建日記");
    if (myGroupName == null || "全部日記".equals(myGroupName)) {
    myGroupName = "默認日記";
    }
    tv_new_group.setText(myGroupName);
    myNoteTime = CommonUtil.date2string(new Date());
    tv_new_time.setText(myNoteTime);
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    4.5 日記詳情頁功能實現(xiàn)關(guān)鍵代碼
    private void initView() {
    Toolbar toolbar = findViewById(R.id.toolbar_note);
    toolbar.setTitle("日記詳情");
    setSupportActionBar(toolbar);
    if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    //toolbar.setNavigationIcon(R.drawable.ic_dialog_info);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    finish();
    }
    });
    FloatingActionButton fab = findViewById(R.id.fab_note);
    fab.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
    Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
    .setAction("Action", null).show();
    }
    });
    iwHelper = ImageWatcherHelper.with(this, new GlideSimpleLoader());
    GroupDao groupDao = new GroupDao(this);
    loadingDialog = new ProgressDialog(this);
    loadingDialog.setMessage("數(shù)據(jù)加載中...");
    loadingDialog.setCanceledOnTouchOutside(false);
    loadingDialog.show();
    //日記標題
    TextView tv_note_title = findViewById(R.id.tv_note_title);//標題
    tv_note_title.setTextIsSelectable(true);
    tv_note_content = findViewById(R.id.tv_note_content);//內(nèi)容
    //日記創(chuàng)建時間
    TextView tv_note_time = findViewById(R.id.tv_note_time);
    //選擇日記分類
    TextView tv_note_group = findViewById(R.id.tv_note_group);
    try {
    Intent intent = getIntent();
    Bundle bundle = intent.getBundleExtra("data");
    note = (Note) bundle.getSerializable("note");
    if (note != null) {
    myTitle = note.getTitle();
    myContent = note.getContent();
    Group group = groupDao.queryGroupById(note.getGroupId());
    if (group != null) {
    myGroupName = group.getName();
    tv_note_group.setText(myGroupName);
    }
    tv_note_title.setText(myTitle);
    tv_note_content.post(new Runnable() {
    @Override
    public void run() {
    dealWithContent();
    }
    });
    tv_note_time.setText(note.getCreateTime());
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

  2. 實驗結(jié)果及分析
    5.1 注冊登錄測試

分析:能夠成功注冊登錄,登錄成功后會提示是夠允許讀取權(quán)限
5.2 寫帶圖片的日記測試

分析:能夠成功寫入文字和插入圖片
5.3 日記列表測試

分析:能夠成功加載日記列表和長按刪除日記

  1. 體會和建議

1)通過半個學期的學習,基本掌握了Android應用程序開發(fā)的一般流程。對常用控件基本掌握其用法,對其事件的監(jiān)聽方法也基本掌握。學習Android不僅是對前沿開發(fā)技術(shù)的了解,也是對編程知識的一次提升。

2)通過學習Android的控件、布局、Activity、Service等一系列基礎(chǔ)知識,對整個Android的開發(fā)有了大致的了解。例如:要的布局(或者控件),在學習界面中,我發(fā)現(xiàn)Android為我們提供了很好的類似反射機制,通過Layout文件夾下的配置文件,可以快速的形成界面,在配置文件可以設(shè)置屬性或者樣式都是很快捷方便對比較特殊的界面也可以通過處理嵌入到指定的界面,同樣你可以通過java代碼直接創(chuàng)建View進行添加,不過這種方式比較復雜。

3)對一些點擊、選中、按鍵等處理的事件,界面之間的跳轉(zhuǎn)Intent管理,通過Bundle對數(shù)據(jù)在界面之間進行傳輸。

android是一種很錯的手機系統(tǒng),使用起來簡單,而且可以根據(jù)自己的需求選擇適合自己的版本,非常的方便。我要多多學習關(guān)于android的知識,在未來,將android系統(tǒng)研發(fā)的更加人性化,使用起來更加的舒適。

設(shè)計成績評定

注:放最后一頁,不要跨頁。

安卓期末大作業(yè)——日記APP的評論 (共 條)

分享到微博請遵守國家法律
北安市| 会同县| 宜兰县| 延川县| 叶城县| 三台县| 怀柔区| 陕西省| 兖州市| 夏津县| 永平县| 兴国县| 海门市| 连江县| 龙海市| 嘉善县| 淮安市| 来安县| 尼玛县| 祥云县| 阜宁县| 介休市| 焉耆| 和田县| 桐乡市| 达日县| 富裕县| 尼勒克县| 四会市| 江油市| 保定市| 鱼台县| 年辖:市辖区| 陆良县| 庐江县| 定远县| 恩平市| 松滋市| 柘荣县| 曲阜市| 蕲春县|