• Andriod小型管理系统(Activity,SQLite库操作,ListView操作)(源代码下载)


    学习了一阵子的Android开发技术,花了几天,把不懂的,懂的晚上实践了一下,使用常用的各种方法

    过几天要考驾校理论了,得看书了

    系统登录时会自动添加用户 admin admin 登录后添加新记录,删除记录,修改密码等操作

    上图

    系统登录

     

    数据列表
     

    信息添加
     

    修改密码

     

     

    系统登录代码:

     

         butlogin.setOnClickListener(new OnClickListener() {
                
                @Override
                public void onClick(View v) {
                    
                    String user=txtuser.getText().toString();
                    String Pass=txtpass.getText().toString();
                //    showDialog(user+"aaaaaaaaaaaaaaaaaaa"+Pass);    
                    
                    DBHelper dbhelper=new DBHelper(getApplicationContext());
                    Cursor c=dbhelper.queryUser();
                      if(c.getCount()>0)
                      {
                    
                          if(c.moveToFirst())
                         {
                              
                               c.move(0);
                               String id=c.getString(0);
                               String username=c.getString(1);
                               String userpass=c.getString(2);
                               if(user.equals(username)&&Pass.equals(userpass))
                               {
                                 //  showDialog("正确");
                                   
                                   Intent intent=new Intent(Login.this,manage.class);
                                    startActivity(intent);
                                   
                               }
                               else
                               {
                                                       
                                   showDialog("用户名或密码错误");
                                   
                                 
                               }
                             
                              
                             
                        
                          }
                      }
                      else
                      {
                            ContentValues values=new ContentValues();
                            values.put("username", "admin");
                            values.put("userpass", "admin");
                            
                            DBHelper helper=new DBHelper(getApplicationContext());
                            helper.insertUser(values);
                            
                            Intent intent=new Intent(Login.this,manage.class);
                            startActivity(intent);
                          
                      }
                    
                    
                    
                }    
            });
            
            

           

    代码比较简单,不贴了,具体请看代码 

    源代码下载

    点击下载

     

  • 相关阅读:
    群辉:服务器错误 错误代码38
    wireshark filter manualpage
    收集下shell使用笔记
    Android kernel LOGO的更换方法
    java实现截屏
    [转]android4.0.3 修改启动动画和开机声音
    博客搬迁
    idea 2017.3创建springboot项目报无效的源发行版: 1.8或者Unsupported major.minor version 52.0的解决方案
    关于mybatis查询集合返回为[null]的问题
    关于mybatis中resultType返回null的问题
  • 原文地址:https://www.cnblogs.com/Guroer/p/2232147.html
Copyright © 2020-2023  润新知