基于Android的个人财务管理系统的设计与实现.

 博主介绍:本人专注于Android/java/数据库/微信小程序技术领域的开发,以及有好几年的计算机毕业设计方面的实战开发经验和技术积累;尤其是在安卓(Android)的app的开发和微信小程序的开发,很是熟悉和了解;本人也是多年的Android开发人员;希望我发布的此篇文件可以帮助到您;

🍅文章末尾获取源码下载方式🍅

一、项目介绍

1.注册登录模块:完成对用户的注册,以及用户登录应用的功能,对密码要求至少8位,可以识别出账号是否注册过,登录之后有欢迎词。
2.个人信息模块:完成对用户对自己的用户名修改,头像进行设置和修改的功能,账号退出,账户删除,修改密码。
3.用户支出收入管理模块:完成用户收入支出信息查看、新增、删除、修改、提供备注等功能,指的是一个一个删除,可以查看历史账目,显示支出各个账目所占百分比,收入各个账目所占百分比。
4.可视化模块:可以以以饼图形式显示支出信息收入信息分类统计的功能。
5.新闻模块:完成新闻发布页面的资料新增、删除、修改等功能。
6.类别管理:可以让用户添加新的支出类别,细化支出内容
7.固定开销:可以根据每个消费类别进行每月限额,超过限额会有提示
8.每月限额:可以让用户设置每月总支出限额,超过限额会有提示
9.导出消费记录:可以导出消费记录,备份每月支出账目,以xlsx文件形式导出,excel或者wps可以查看
10.进入app时可以设置是否要输入密码解锁
11.定时提醒用户记账,自定义提醒时间
12.用户在app内备忘录上自定义内容提醒,比如几月几号还行用卡之类的
13.可以有计算银行本息和,按照单利和复利计算
14.收入和支出内容可以分别批量删除

二、运行环境

1:客户端使用Android stuido进行开发;
2:服务端后台使用Myeclipse2014进行开发;
3:mysql数据库进行数据存储;
4:需要jdk1.7以上
5:使用雷电模拟器或者Androidstuio自带的模拟器进行运行

三、使用技术

总体设计逻辑和思路:
1:先设计数据库表文件
2:写服务端jsp页面以及写api接口给客户端提供数据
3:完成后台服务端的数据交互,也就是jsp页面数据的存储和显示
4:进行客户端页面的开发;
5:进行客户端对api接口的调用,也就是获取数据库的数据以及在客户端进行显示

移动端:
1:使用android原生控件以及xml布局文件来完成界面的显示
2:使用java代码完成功能的数据和逻辑交互
3:使用http网络请求完成数据的请求;
4:使用json数据解析完成客户端数据的回调和显示

服务端后台:
1:使用mysql完成数据的存储
2:使用jdbc完成数据库和代码的逻辑交互
3:使用jsp完成网页数据的显示
4:使用java代码完成api接口的编写以及以及数据的回调

四、软件截图

 五、数据库设计

/*
Navicat MySQL Data Transfer

Source Server         : mydata
Source Server Version : 50537
Source Host           : localhost:3306
Source Database       : jizhangdb

Target Server Type    : MYSQL
Target Server Version : 50537
File Encoding         : 65001

Date: 2019-11-15 18:13:32
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for lookmoneymsg
-- ----------------------------
DROP TABLE IF EXISTS `lookmoneymsg`;
CREATE TABLE `lookmoneymsg` (
  `lookMoneyId` int(50) NOT NULL AUTO_INCREMENT,
  `lookMoneyUserId` varchar(100) DEFAULT NULL,
  `lookMoneyUserName` varchar(255) DEFAULT NULL,
  `lookMoneyTypeId` varchar(100) DEFAULT NULL,
  `lookMoneyTypeName` varchar(255) DEFAULT NULL,
  `lookMoneyMoney` double(255,2) DEFAULT NULL,
  `lookMoneyTime` varchar(100) DEFAULT NULL,
  `typeMessage` varchar(255) DEFAULT NULL,
  `monthMessage` varchar(255) DEFAULT NULL,
  `tipMessage` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`lookMoneyId`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of lookmoneymsg
-- ----------------------------
INSERT INTO `lookmoneymsg` VALUES ('44', '32', 'pony', '6', '工资', '600.00', '2019-11-12', '1', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('45', '32', 'pony', '8', '吃饭', '200.00', '2019-11-12', '2', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('46', '32', 'pony', '6', '工资', '900.00', '2019-11-12', '1', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('47', '32', 'pony', '9', '旅游', '300.00', '2019-11-12', '2', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('49', '32', 'pony', '8', '兼职', '650.00', '2019-11-12', '1', '11', '111');
INSERT INTO `lookmoneymsg` VALUES ('50', '32', 'pony', '12', '微信', '50.00', '2019-11-12', '1', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('54', '32', 'pony9', '8', '兼职', '100.00', '2019-11-13', '1', '11', null);
INSERT INTO `lookmoneymsg` VALUES ('55', '32', 'pony9', '8', '吃饭', '20.00', '2019-11-13', '2', '11', '111');
INSERT INTO `lookmoneymsg` VALUES ('56', '32', 'pony9', '8', '吃饭', '45.00', '2019-11-15', '2', '11', '消费的备注信息');
INSERT INTO `lookmoneymsg` VALUES ('57', '32', 'pony9', '8', '吃饭', '6.00', '2019-11-15', '2', '11', '消费的备注信息');
INSERT INTO `lookmoneymsg` VALUES ('58', '32', 'pony9', '9', '旅游', '30.00', '2019-11-15', '2', '11', 'qunalinewan');

-- ----------------------------
-- Table structure for newsmessage
-- ----------------------------
DROP TABLE IF EXISTS `newsmessage`;
CREATE TABLE `newsmessage` (
  `newsId` int(11) NOT NULL AUTO_INCREMENT,
  `newsTitle` varchar(255) DEFAULT NULL,
  `newsContent` varchar(1000) DEFAULT NULL,
  `newsTime` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`newsId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of newsmessage
-- ----------------------------
INSERT INTO `newsmessage` VALUES ('2', '1111111', '11111111111111111111111111111111111111', '2019-11-12 21:35');
INSERT INTO `newsmessage` VALUES ('3', '1111111111111', '1111111111111111111111111111111111111111111111111111111111', '2019-11-12 21:35');

-- ----------------------------
-- Table structure for typeincomemsg
-- ----------------------------
DROP TABLE IF EXISTS `typeincomemsg`;
CREATE TABLE `typeincomemsg` (
  `typeIncomeId` int(50) NOT NULL AUTO_INCREMENT,
  `typeIncomeName` varchar(255) DEFAULT NULL,
  `typeIncomeUserId` varchar(11) DEFAULT NULL,
  `limitMoney` double DEFAULT NULL,
  PRIMARY KEY (`typeIncomeId`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of typeincomemsg
-- ----------------------------
INSERT INTO `typeincomemsg` VALUES ('6', '工资', '32', null);
INSERT INTO `typeincomemsg` VALUES ('7', '二手出售', '32', null);
INSERT INTO `typeincomemsg` VALUES ('8', '兼职', '32', null);
INSERT INTO `typeincomemsg` VALUES ('12', '微信', '32', null);
INSERT INTO `typeincomemsg` VALUES ('13', '支付宝', '32', '600');
INSERT INTO `typeincomemsg` VALUES ('14', '雷伊111', '32', '600');

-- ----------------------------
-- Table structure for typepaymsg
-- ----------------------------
DROP TABLE IF EXISTS `typepaymsg`;
CREATE TABLE `typepaymsg` (
  `typePayId` int(50) NOT NULL AUTO_INCREMENT,
  `typePayName` varchar(255) DEFAULT NULL,
  `typePayUserId` varchar(11) DEFAULT NULL,
  `limitMoney` double(255,0) DEFAULT NULL,
  PRIMARY KEY (`typePayId`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of typepaymsg
-- ----------------------------
INSERT INTO `typepaymsg` VALUES ('8', '吃饭', '32', '500');
INSERT INTO `typepaymsg` VALUES ('9', '旅游', '32', '600');
INSERT INTO `typepaymsg` VALUES ('10', '购物', '32', '1000');
INSERT INTO `typepaymsg` VALUES ('11', '买东西', '32', '50');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `uid` int(50) NOT NULL AUTO_INCREMENT,
  `uname` varchar(100) NOT NULL,
  `uphone` varchar(100) NOT NULL,
  `upswd` varchar(100) NOT NULL,
  `utime` varchar(100) NOT NULL,
  `uImg` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('32', 'pony9', '15249241111', '123456', '2019-11-11 21:35', '20191113170759.jpg');
 

六、部分代码

1:登录代码


public class LoginActivity extends BaseActivity {

    // 登录用户名称
    private EditText mLoginNumber;
    // 登录密码
    private EditText mLoginPswd;
    // 登录按钮
    private Button mLogin;
    private Button mEnterpriseQuery;
    private LinearLayout mllTop;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loginnew);
        initWidget();
    }

    /**
     * 控件初始化
     */
    @Override
    public void initWidget() {

        mdialog = new LoadingDialog(this, "正在登录");
        mLoginNumber = (EditText) findViewById(R.id.mLoginNumber);
        mLoginPswd = (EditText) findViewById(R.id.mLoginPswd);
        mLogin = (Button) findViewById(R.id.mLogin);
        mEnterpriseQuery = (Button) findViewById(R.id.mEnterpriseQuery);
        // mLoginNumber.setInputType(EditorInfo.TYPE_CLASS_PHONE);
        // 事件的监听
        mLogin.setOnClickListener(this);
        mEnterpriseQuery.setOnClickListener(this);
        // 给输入框设置默认的测试数据
        mLoginNumber.setSelection(mLoginNumber.getText().length());
        // mLoginNumber.setText("TEA20170123164556");
        mLoginNumber.setText("15249241111");
        mLoginPswd.setText("123456");
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {
        case R.id.mLogin:
            if (TextUtils.isEmpty(mLoginNumber.getText().toString())) {
                ToastUtil.ShowCentre(LoginActivity.this, "请输入手机号码");
                return;
            }
            if (TextUtils.isEmpty(mLoginPswd.getText().toString())) {
                ToastUtil.ShowCentre(LoginActivity.this, "请输入登录密码");
                return;
            }

            //
            LoginUserPost(true);
            //
            break;
        case R.id.mEnterpriseQuery:
            Intent mEnterpriseQuery = new Intent(LoginActivity.this, RegisterActivity.class);
            startActivity(mEnterpriseQuery);
        default:
            break;
        }
    }

    @Override
    public void initData() {
    }

    /**
     * 用户的登录
     * 
     * @param isShow
     */
    private void LoginUserPost(boolean isShow) {
        AjaxParams params = new AjaxParams();
        params.put("action_flag", "login");
        params.put("uphone", mLoginNumber.getText().toString());
        params.put("pswd", mLoginPswd.getText().toString());
        httpPost(Consts.URL + Consts.APP.RegisterAction, params, Consts.actionId.resultFlag, isShow, "正在登录...");
    }

    @Override
    protected void callBackSuccess(ResponseEntry entry, int actionId) {
        super.callBackSuccess(entry, actionId);

        switch (actionId) {
        case Consts.actionId.resultFlag:

            if (null != entry.getData() && !TextUtils.isEmpty(entry.getData())) {
                MemberUserUtils.setLoginFlag(this, "true");
                UserModel userModel = mGson.fromJson(entry.getData(), UserModel.class);
                MemberUserUtils.setUid(LoginActivity.this, userModel.getUid());
                MemberUserUtils.setName(LoginActivity.this, userModel.getUname());
                MemberUserUtils.putBean(LoginActivity.this, "user_messgae", userModel);
                Intent intent = new Intent(LoginActivity.this, FrameworkActivity.class);
                startActivity(intent);
                finish();

            }
            break;

        }

    }

    @Override
    protected void callBackAllFailure(String strMsg, int actionId) {
        super.callBackAllFailure(strMsg, actionId);

        ToastUtil.show(LoginActivity.this, strMsg);

    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        Log.i("pony_log", MemberUserUtils.getIsOpen(this));

        if (MemberUserUtils.getIsOpen(this).equals("ok")) {
            
            if(!MemberUserUtils.getPswdLinShi(this).equals("ok")){
                Intent mrlAddress = new Intent(this, PswdMessageActivity.class);
                this.startActivity(mrlAddress);
            }
        
        }
    }
}
 

2:添加信息代码


public class CreateMessageActivity extends BaseActivity {

    // title
    private TextView mTvTitle;
    // 返回
    private ImageView mIvBack;
    // 查询按钮
    private Button mbtnAdd;

    private EditText metMoney;
    private EditText metMessage;
    private Button mbtnchoice;
    private Button mbtnDate;
    private String timeMsg;
    private RadioGroup mrgChoice;
    private RadioButton mrbIncome = null;
    private RadioButton mrbCost = null;

    private List<CategoryModel> mlistData = new ArrayList<CategoryModel>();
    private DialogListMsg dialogListMsg;
    private PractitionersAdapter listaAdapter;

    private DialogMsg dialogMsg;
    private int incomeTotalMoney = 0;
    private int costTotalMoney = 0;

    private List<PayModel> list_result_pay = new ArrayList<PayModel>();
    private List<IncomeModel> list_result_income = new ArrayList<IncomeModel>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_create);
        initWidget();
        initData();
    }

    @Override
    public void initWidget() {

        dialogMsg = new DialogMsg(this);
        dialogMsg.Set_Msg("您的金额超出了最大额度");
        dialogListMsg = new DialogListMsg(this);
        dialogListMsg.setTitle().setText("请选择类别");
        listaAdapter = new PractitionersAdapter(this);

        mrbIncome = (RadioButton) findViewById(R.id.mrbIncome);
        mrbCost = (RadioButton) findViewById(R.id.mrbCost);
        mrgChoice = (RadioGroup) findViewById(R.id.mrgChoice);
        metMoney = (EditText) findViewById(R.id.metMoney);
        metMessage = (EditText) findViewById(R.id.metMessage);
        metMoney.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); 
        metMessage.setText("消费的备注信息");

        mbtnchoice = (Button) findViewById(R.id.mbtnchoice);
        mbtnDate = (Button) findViewById(R.id.mbtnDate);
        mbtnAdd = (Button) findViewById(R.id.mbtnAdd);
        mIvBack = (ImageView) findViewById(R.id.mIvBack);
        mTvTitle = (TextView) findViewById(R.id.mTvTitle);
        mTvTitle.setText("添加数据");
        mIvBack.setVisibility(View.VISIBLE);
        mIvBack.setOnClickListener(this);
        mbtnAdd.setOnClickListener(this);
        mbtnDate.setOnClickListener(this);
        mbtnchoice.setOnClickListener(this);

        if (this.getIntent().getStringExtra("msg").equals("2")) {
            mbtnchoice.setText("请选择支出类别");
            choiceFlag = 2;
        } else {
            mbtnchoice.setText("请选择收入类别");
            choiceFlag = 1;
        }

    }

    private int choiceFlag = 0;

    @Override
    public void onClick(View v) {

        switch (v.getId()) {
        case R.id.mIvBack:
            CreateMessageActivity.this.finish();
            break;

        case R.id.mbtnDate:
            showTime();
            break;

        case R.id.mbtnchoice:

            if (this.getIntent().getStringExtra("msg").equals("1")) {
                choiceFlag = 1;
                listIncome(false);
            } else {
                choiceFlag = 2;
                listPay(false);

            }

            Log.e("pony_log", mlistData.size() + "");

            break;
        case R.id.mbtnAdd:

            if (TextUtils.isEmpty(metMoney.getText().toString())) {
                ToastUtil.ShowCentre(CreateMessageActivity.this, "请输入消费金额");
                return;
            }
            
            if (choiceFlag==2) {
                
                double zhichuTotal = Double.valueOf(list_result_pay.get(posIndex).getTotalMoney())+Double.valueOf(metMoney.getText().toString());
                
                if(zhichuTotal>Double.valueOf(MemberUserUtils.getCostMoney(this))){
                    ToastUtil.ShowCentre(CreateMessageActivity.this, "超过当月限额");
                    return;
                }
                
                double xiane = Double.valueOf(list_result_pay.get(posIndex).getLimitMoney());
                double yijing = Double.valueOf(list_result_pay.get(posIndex).getTypeMoney())+Double.valueOf(metMoney.getText().toString());
                if(yijing>xiane){
                    ToastUtil.ShowCentre(CreateMessageActivity.this, "超过"+list_result_pay.get(posIndex).getTypePayName()+"限额");
                }else{
                    createTopicPost(true);
                }
            } else{
                createTopicPost(true);
            }
            
        
            break;
        }
    }

    private int posIndex = 0;

    @Override
    public void initData() {
        // 数据的获取

        dialogListMsg.show_listview().setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
                dialogListMsg.Close();
                posIndex = pos;
                mbtnchoice.setText(mlistData.get(pos).getTypeName());
            }
        });

        dialogMsg.submit_ok().setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                dialogMsg.Close();

            }
        });

        dialogMsg.submit_no().setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                dialogMsg.Close();
            }
        });

    }

    /**
     * 支出数据类型
     * 
     * @param isShow
     */
    private void listIncome(boolean isShow) {
        AjaxParams params = new AjaxParams();
        params.put("action_flag", "listIncome");
        params.put("userId", MemberUserUtils.getUid(this));
        httpPost(Consts.URL + Consts.APP.MoneyAction, params, Consts.actionId.resultCode, isShow, "正在注册...");
    }

    private void listPay(boolean isShow) {
        AjaxParams params = new AjaxParams();
        params.put("action_flag", "listPay");
        params.put("userId", MemberUserUtils.getUid(this));
        httpPost(Consts.URL + Consts.APP.MoneyAction, params, Consts.actionId.resultFlag, isShow, "正在注册...");
    }

    private void createTopicPost(boolean isShow) {
        AjaxParams params = new AjaxParams();
        params.put("action_flag", "addMoney");
        params.put("lookMoneyUserId", MemberUserUtils.getUid(this));
        params.put("lookMoneyUserName", MemberUserUtils.getName(this));
        params.put("lookMoneyTypeId", mlistData.get(posIndex).getTypeId());
        params.put("lookMoneyTypeName", mlistData.get(posIndex).getTypeName());
        params.put("lookMoneyMoney", metMoney.getText().toString());
        params.put("lookMoneyTime", mbtnDate.getText().toString());

        if (this.getIntent().getStringExtra("msg").equals("1")) {
            params.put("typeMessage", "1");
        } else {
            params.put("typeMessage", "2");
        }

        params.put("monthMessage", mbtnDate.getText().toString().substring(5, 7));
        params.put("tipMessage", metMessage.getText().toString());
        
        httpPost(Consts.URL + Consts.APP.MoneyAction, params, Consts.actionId.resultState, isShow, "正在注册...");
    }

    @Override
    protected void callBackSuccess(ResponseEntry entry, int actionId) {
        super.callBackSuccess(entry, actionId);

        switch (actionId) {
        case Consts.actionId.resultCode:
            if (null != entry.getData() && !TextUtils.isEmpty(entry.getData())) {

                String jsonMsg = entry.getData().substring(1, entry.getData().length() - 1);
                if (null != jsonMsg && !TextUtils.isEmpty(jsonMsg)) {
                    list_result_income.clear();
                    list_result_income = mGson.fromJson(entry.getData(), new TypeToken<List<IncomeModel>>() {
                    }.getType());
                    mlistData.clear();
                    for (int i = 0; i < list_result_income.size(); i++) {
                        CategoryModel categoryModel = new CategoryModel();
                        categoryModel.setTypeId(list_result_income.get(i).getTypeIncomeId());
                        categoryModel.setTypeName(list_result_income.get(i).getTypeIncomeName());
                        mlistData.add(categoryModel);
                    }

                    listaAdapter.setData(mlistData);
                    dialogListMsg.show_listview().setAdapter(listaAdapter);
                    listaAdapter.notifyDataSetChanged();
                    dialogListMsg.Show();
                } else {
                }
            }
            break;

        case Consts.actionId.resultFlag:
            String jsonMsg = entry.getData().substring(1, entry.getData().length() - 1);
            if (null != jsonMsg && !TextUtils.isEmpty(jsonMsg)) {
                list_result_pay.clear();
                list_result_pay = mGson.fromJson(entry.getData(), new TypeToken<List<PayModel>>() {
                }.getType());

                mlistData.clear();

                for (int i = 0; i < list_result_pay.size(); i++) {
                    CategoryModel categoryModel = new CategoryModel();
                    categoryModel.setTypeId(list_result_pay.get(i).getTypePayId());
                    categoryModel.setTypeName(list_result_pay.get(i).getTypePayName());
                    mlistData.add(categoryModel);
                }
                listaAdapter.setData(mlistData);
                dialogListMsg.show_listview().setAdapter(listaAdapter);
                listaAdapter.notifyDataSetChanged();
                dialogListMsg.Show();
            } else {
            }

            break;
        case Consts.actionId.resultState:
            
            if (choiceFlag==1) {
                MoneyInObservable.getInstance().notifyStepChange("ok");
            } else {
                MoneyOutObservable.getInstance().notifyStepChange("ok");
            }
            MoneyObservable.getInstance().notifyStepChange("ok");
            ToastUtil.show(CreateMessageActivity.this, entry.getRepMsg());
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    finish();
                }
            }, 2000);
            break;
        }

    }

    @Override
    protected void callBackAllFailure(String strMsg, int actionId) {
        super.callBackAllFailure(strMsg, actionId);
        ToastUtil.show(CreateMessageActivity.this, strMsg);

    }

    WheelMain wheelMain;
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

    private void showTime() {
        LayoutInflater inflater1 = LayoutInflater.from(this);
        final View timepickerview1 = inflater1.inflate(R.layout.timepicker, null);
        ScreenInfo screenInfo1 = new ScreenInfo(this);
        wheelMain = new WheelMain(timepickerview1);
        wheelMain.screenheight = screenInfo1.getHeight();
        Calendar calendar = Calendar.getInstance();
        String time1 = calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-" + calendar.get(Calendar.DAY_OF_MONTH) + "";
        Calendar calendar1 = Calendar.getInstance();
        if (JudgeDate.isDate(time1, "yyyy-MM-dd")) {
            try {
                calendar1.setTime(dateFormat.parse(time1));
            } catch (ParseException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        int year1 = calendar1.get(Calendar.YEAR);
        int month1 = calendar1.get(Calendar.MONTH);
        int day1 = calendar1.get(Calendar.DAY_OF_MONTH);
        wheelMain.initDateTimePicker(year1, month1, day1);

        final MyAlertDialog dialog = new MyAlertDialog(this).builder().setTitle("选择时间")
        // .setMsg("再连续登陆15天,就可变身为QQ达人。退出QQ可能会使你现有记录归零,确定退出?")
        // .setEditText("1111111111111")
                .setView(timepickerview1).setNegativeButton("取消", new OnClickListener() {
                    @Override
                    public void onClick(View v) {

                    }
                });
        dialog.setPositiveButton("保存", new OnClickListener() {
            @Override
            public void onClick(View v) {
                
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");// 设置日期格式
                

                String myString = wheelMain.getTime() + "";
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
                Date choiceTime;
                Date nowTime;
                try {
                    choiceTime = sdf.parse(myString);
                    nowTime = sdf.parse(df.format(new Date()));        
                    
                    if (choiceTime.getTime() < nowTime.getTime()) {
                        System.out.println("dt1在dt2后");
//                        1525622400000,1525680343197
                        Log.i("pony_log", choiceTime.getTime()+","+nowTime.getTime());
                        ToastUtil.ShowCentre(CreateMessageActivity.this, "请选择大于今日的日期");
                    } else {// 相等
                        timeMsg = wheelMain.getTime();
                        mbtnDate.setText(wheelMain.getTime());
                    }

                } catch (ParseException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                // 设置日期格式
                // timeMsg = wheelMain.getTime() + df.format(new Date());

            }
        });
        dialog.show();

    }

}
 

七、浏览更多Android毕业设计

毕业设计-基于android的租房信息发布平台的APP_信息发布app源码_Android毕业设计源码的博客-CSDN博客

毕业设计-基于android选课系统的设计与实现_android学生选课系统_Android毕业设计源码的博客-CSDN博客

毕业设计之校园一卡通管理系统的设计与实现_一卡通管理系统实现_Android毕业设计源码的博客-CSDN博客

基于Android的校园二手闲置物品交易系统设计与实现_基于android的二手交易平台_Android毕业设计源码的博客-CSDN博客

基于androidstudio校园快递APP系统的设计与实现_android studio论文_Android毕业设计源码的博客-CSDN博客

基于android的商城购物定制APP_安卓开发购物app_Android毕业设计源码的博客-CSDN博客

更多毕业设计可以浏览我的个人主页哦!

八、源码下载

https://download.csdn.net/download/u014388322/88352968

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Android毕业设计源码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值