1. 程式人生 > >Android Studio 一個完整的APP例項(附原始碼和資料庫)

Android Studio 一個完整的APP例項(附原始碼和資料庫)

前言:

這是我獨立做的第一個APP,是一個記賬本APP。

This is the first APP, I've ever done on my own. It's a accountbook APP.

 

原始碼:

          歡迎satr or fork

 

備註:

APP中所涉及到的圖示請勿商用

 

效果圖

(備註:在把圖片製作成gif時,圖片的質量受損,所以最終呈現出來的gif圖片,背景變得有些模糊)

 

開發環境

IDE:Android Studio

Database:SQLite

 

功能介紹

該APP共包含6個功能,分別是:

1、登入&註冊功能:
 進入該介面,預設是讓使用者進行登入操作;
 若使用者之前沒有註冊過,則會提示讓使用者進行註冊;
 若使用者忘記登入密碼,也有重置密碼的功能。

2、收入&支出功能:
 該功能分為兩個頁籤:明細、類別報表
 這兩個頁籤內容,都根據月份來統計呈現(開發中,目前是呈現所有收支明細)
 並根據月份,顯示當月的收入與支出(開發中,目前是呈現固定值)

 明細頁籤:
  在該頁籤最下方會顯示【記一筆】按鈕,點選該按鈕,會提示讓使用者選擇記錄的型別,是收入 or 支出
  然後會進入到記錄收支明細的介面
  根據使用者的選擇型別,來呈現不同的內容
  當用戶錄入好收支明細,點選儲存,會返回到明細頁籤,此時會重新整理明細頁籤的內容(重新整理功能開發中)

 類別報表頁籤:
  該頁籤會根據使用者的收支明細的類別來進行統計,呈現方式是圓形餅圖(具體的統計邏輯開發中)

3、統計功能:
 該功能分為兩個頁籤:明細、類別報表(該功能和收入&支出功能類似)
 這兩個頁籤內容,都根據月份來統計呈現(開發中,目前是呈現所有收支明細)
 並根據月份,顯示當月的結餘,以及相比上月支出(開發中,目前是呈現固定值)

4、特殊設定功能:該功能正在設計中。

5、心願牆功能:該功能正在設計中。

6、關於我們功能:該功能主要是對APP進行簡要介紹。

 

資料庫設計:

目前APP共涉及到三個表,分別是:使用者資訊表、配置表、收支明細表

 1
public void onCreate(SQLiteDatabase db){ 2 //user table 3 db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," + 4 "userID text not null," + 5 "pwd text not null)"); 6 7 //Configuration table 8 db.execSQL("create table if not exists refCode_tb(_id integer primary key autoincrement," + 9 "CodeType text not null," + 10 "CodeID text not null," + 11 "CodeName text null)"); 12 13 //costDetail_tb 14 db.execSQL("create table if not exists basicCode_tb(_id integer primary key autoincrement," + 15 "userID text not null," + 16 "Type integer not null," + 17 "incomeWay text not null," + 18 "incomeBy text not null," + 19 "category text not null," + 20 "item text not null," + 21 "cost money not null," + 22 "note text not null," + 23 "makeDate text not null)"); 24 }

 

教程

以下博文是根據APP中涉及到的功能進行整理的,如下:

 

參考:

  • 首頁的旋轉選單參考該博文:參考

 

版本:

目前的版本為V1.0

APP還有很多功能需要繼續完善,希望有興趣的小夥伴可以一起參與進來,和我一起來開發完善。

 

一點想說的話

不論遇到什麼困難,都不應該成為我們放棄的理由