登录
首页 » Java » listviewheSQLitezhishi

listviewheSQLitezhishi

于 2016-07-25 发布 文件大小:6464KB
0 74
下载积分: 1 下载次数: 14

代码说明:

   注意:本项目是基于android studio开发的,eclipse可能无法直接使用。 本项目是一个简单的基于安卓的记事本项目源码,添加或删除数据的时候会出现显示bug(实际数据不会受到影响),bug体现在添加或删除一条数据以后会在listview里面会展示复制一遍操作后的数据。而不会清除原有的列表文本。新手朋友可以拿这个项目来试试手感,顺便看看能不能独立解决这个问题。 本项目涉及的知识点有: 1、SQLite的基本使用,增删查改 2、listview,adapeter的基本使用 3、activity生命周期 4、intent、bundle传递参数 5、AlertDialog的基本使用(Note: this project is based on the development of studio eclipse, Android may not be able to directly use. This project is a simple Notepad program source code based on Android, add or delete data will appear when the display bug (actual data will not be affected), bug reflected in add or remove a data will be in inside the listview will show copy again after the operation data. And will not clear the original list of text. Novice friends can take this project to try to feel, by the way to solve this problem can not be solved independently. The knowledge points involved in this project are: 1, the basic use of SQLite, CRUD 2, listview, the basic use of adapeter 3, activity life cycle 4, intent, bundle transfer parameters 5, the basic use of AlertDialog)

文件列表:

Android项目源码带bug记事本可以学习基本的listview和SQLite知识
............................................................\My_Note
............................................................\.......\.gitignore,105,2015-12-13
............................................................\.......\app
............................................................\.......\...\.gitignore,8,2015-12-13
............................................................\.......\...\app.iml,7608,2015-12-13
............................................................\.......\...\build
............................................................\.......\...\.....\generated
............................................................\.......\...\.....\.........\res
............................................................\.......\...\.....\.........\...\resValues
............................................................\.......\...\.....\.........\...\.........\androidTest
............................................................\.......\...\.....\.........\...\rs
............................................................\.......\...\.....\.........\...\..\androidTest
............................................................\.......\...\.....\.........\...\..\...........\debug
............................................................\.......\...\.....\.........\...\..\debug
............................................................\.......\...\.....\.........\source
............................................................\.......\...\.....\.........\......\aidl
............................................................\.......\...\.....\.........\......\....\androidTest
............................................................\.......\...\.....\.........\......\....\...........\debug
............................................................\.......\...\.....\.........\......\....\debug
............................................................\.......\...\.....\.........\......\buildConfig
............................................................\.......\...\.....\.........\......\...........\androidTest
............................................................\.......\...\.....\.........\......\...........\...........\debug
............................................................\.......\...\.....\.........\......\...........\...........\.....\com
............................................................\.......\...\.....\.........\......\...........\...........\.....\...\example
............................................................\.......\...\.....\.........\......\...........\...........\.....\...\.......\my_note
............................................................\.......\...\.....\.........\......\...........\...........\.....\...\.......\.......\test
............................................................\.......\...\.....\.........\......\...........\...........\.....\...\.......\.......\....\BuildConfig.java,455,2015-12-13
............................................................\.......\...\.....\.........\......\...........\debug
............................................................\.......\...\.....\.........\......\...........\.....\com
............................................................\.......\...\.....\.........\......\...........\.....\...\example
............................................................\.......\...\.....\.........\......\...........\.....\...\.......\my_note
............................................................\.......\...\.....\.........\......\...........\.....\...\.......\.......\BuildConfig.java,445,2015-12-13
............................................................\.......\...\.....\.........\......\r
............................................................\.......\...\.....\.........\......\.\androidTest
............................................................\.......\...\.....\.........\......\.\...........\debug
............................................................\.......\...\.....\.........\......\.\debug
............................................................\.......\...\.....\.........\......\.\.....\android
............................................................\.......\...\.....\.........\......\.\.....\.......\support
............................................................\.......\...\.....\.........\......\.\.....\.......\.......\v7
............................................................\.......\...\.....\.........\......\.\.....\.......\.......\..\appcompat
............................................................\.......\...\.....\.........\......\.\.....\.......\.......\..\.........\R.java,81056,2015-12-13
............................................................\.......\...\.....\.........\......\.\.....\com
............................................................\.......\...\.....\.........\......\.\.....\...\example
............................................................\.......\...\.....\.........\......\.\.....\...\.......\my_note
............................................................\.......\...\.....\.........\......\.\.....\...\.......\.......\R.java,359885,2015-12-13
............................................................\.......\...\.....\.........\......\rs
............................................................\.......\...\.....\.........\......\..\androidTest
............................................................\.......\...\.....\.........\......\..\...........\debug
............................................................\.......\...\.....\.........\......\..\debug
............................................................\.......\...\.....\intermediates
............................................................\.......\...\.....\.............\assets
............................................................\.......\...\.....\.............\......\androidTest
............................................................\.......\...\.....\.............\......\...........\debug
............................................................\.......\...\.....\.............\......\debug
............................................................\.......\...\.....\.............\classes
............................................................\.......\...\.....\.............\.......\debug
............................................................\.......\...\.....\.............\.......\.....\android
............................................................\.......\...\.....\.............\.......\.....\.......\support
............................................................\.......\...\.....\.............\.......\.....\.......\.......\v7
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\appcompat
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$anim.class,813,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$attr.class,8734,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$bool.class,820,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$color.class,3770,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$dimen.class,4283,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$drawable.class,3659,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$id.class,3666,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$integer.class,657,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$layout.class,2313,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$string.class,1430,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$style.class,18523,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R$styleable.class,18065,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\.......\.......\..\.........\R.class,1019,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\com
............................................................\.......\...\.....\.............\.......\.....\...\example
............................................................\.......\...\.....\.............\.......\.....\...\.......\my_note
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\BuildConfig.class,714,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\MainActivity$1.class,1335,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\MainActivity$2.class,1894,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\MainActivity$3.class,901,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\MainActivity.class,7044,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\NoteDateBaseHelper.class,1240,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\noteEdit.class,3830,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$anim.class,786,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$attr.class,8707,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$bool.class,793,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$color.class,3854,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$dimen.class,4354,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$drawable.class,3671,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$id.class,3870,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$integer.class,630,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$layout.class,2379,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$mipmap.class,404,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$string.class,1435,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$style.class,18528,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R$styleable.class,18038,2015-12-13
............................................................\.......\...\.....\.............\.......\.....\...\.......\.......\R.class,944,2015-12-13
............................................................\.......\...\.....\.............\debug
............................................................\.......\...\.....\.............\.....\merging

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • ViewPagerTD
    android viewpager的左右无限循环、自动滑动(about android viewpager infinite loop, automatic sliding)
    2013-11-27 16:50:01下载
    积分:1
  • Android-for-Qt_GPS
    基于qt开发的GPS功能应用程序,可在android平台上运行;需要在necessitas开发环境下编译。(Qt-based application developed by the GPS function, you can run on android platform need necessitas development environment compiler.)
    2013-10-09 11:31:27下载
    积分:1
  • android 3D相册 示例源码下载(有图有源码)
    android 3D相册 示例源码下载(有图有源码)
    2013-10-23下载
    积分:1
  • 微信公众平台模式(JAVA) SDK/微信app
    【核心代码】package com.gson;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.lang.reflect.Field;import java.lang.reflect.Method;import java.util.Date;import java.util.Properties;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.FilterConfig;import javax.servlet.ServletException;import javax.servlet.ServletInputStream;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.log4j.Logger;import com.gson.bean.Articles;import com.gson.bean.InMessage;import com.gson.bean.OutMessage;import com.gson.bean.TextOutMessage;import com.gson.inf.MessageProcessingHandler;import com.gson.util.Tools;import com.gson.util.XStreamFactory;import com.thoughtworks.xstream.XStream;/** * 请求拦截 * * @author GodSon * */public class WeChatFilter implements Filter { private final Logger logger = Logger.getLogger(WeChatFilter.class); private String _token; private String conf = "classPath:wechat.properties"; private String defaultHandler = "com.gson.inf.DefaultMessageProcessingHandlerImpl"; private Properties p; @Override public void destroy() { logger.info("WeChatFilter已经销毁"); } @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; Boolean isGet = request.getMethod().equals("GET"); String path = request.getServletPath(); String pathInfo = path.substring(path.lastIndexOf("/")); if (pathInfo == null) { response.getWriter().write("error"); } else { _token = pathInfo.substring(1); if (isGet) { doGet(request, response); } else { doPost(request, response); } } } private void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding("UTF-8"); response.setContentType("text/xml"); OutMessage oms = new OutMessage(); ServletInputStream in = request.getInputStream(); // 转换微信post过来的xml内容 XStream xs = XStreamFactory.init(false); xs.alias("xml", InMessage.class); String xmlMsg = Tools.inputStream2String(in); logger.debug("输入消息:[" xmlMsg "]"); InMessage msg = (InMessage) xs.fromXML(xmlMsg); // 获取自定消息处理器,如果自定义处理器则使用默认处理器。 String handler = p.getProperty("MessageProcessingHandlerImpl"); if (handler == null) handler = defaultHandler; try { // 加载处理器 Class clazz = Class.forName(handler); MessageProcessingHandler processingHandler = (MessageProcessingHandler) clazz.newInstance(); // 取得消息类型 String type = msg.getMsgType(); Method mt = clazz.getMethod(type "TypeMsg", InMessage.class); oms = (OutMessage) mt.invoke(processingHandler, msg); if (oms == null) { oms = new TextOutMessage(); ((TextOutMessage) oms).setContent("系统错误!"); } setMsgInfo(oms,msg); } catch (Exception e) { logger.error(e); oms = new TextOutMessage(); ((TextOutMessage) oms).setContent("系统错误!"); try { setMsgInfo(oms,msg); } catch (Exception e1) { logger.error(e); } } // 把发送发送对象转换为xml输出 xs = XStreamFactory.init(true); xs.alias("xml", oms.getClass()); xs.alias("item", Articles.class); String xml = xs.toXML(oms); logger.debug("输出消息:[" xml "]"); response.getWriter().write(xml); } private void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String signature = request.getParameter("signature");// 微信加密签名 String timestamp = request.getParameter("timestamp");// 时间戳 String nonce = request.getParameter("nonce");// 随机数 String echostr = request.getParameter("echostr");// // 验证 if (Tools.checkSignature(_token, signature, timestamp, nonce)) { response.getWriter().write(echostr); } } private void setMsgInfo(OutMessage oms,InMessage msg) throws Exception { // 设置发送信息 Class outMsg = oms.getClass().getSuperclass(); Field CreateTime = outMsg.getDeclaredField("CreateTime"); Field ToUserName = outMsg.getDeclaredField("ToUserName"); Field FromUserName = outMsg.getDeclaredField("FromUserName"); ToUserName.setAccessible(true); CreateTime.setAccessible(true); FromUserName.setAccessible(true); CreateTime.set(oms, new Date().getTime()); ToUserName.set(oms, msg.getFromUserName()); FromUserName.set(oms, msg.getToUserName()); } /** * 启动的时候加载wechat.properties配置 可以在过滤器配置wechat.properties路径 */ @Override public void init(FilterConfig config) throws ServletException { String cf = config.getInitParameter("conf"); if (cf != null) { conf = cf; } String classPath = this.getClass().getResource("/").getPath().replaceAll("%20", " "); conf = conf.replace("classPath:", classPath); p = new Properties(); File pfile = new File(conf); if (pfile.exists()) { try { p.load(new FileInputStream(pfile)); } catch (FileNotFoundException e) { logger.error("未找到wechat.properties", e); } catch (IOException e) { logger.error("wechat.properties读取异常", e); } } logger.info("WeChatFilter已经启动!"); }}
    2014-01-21下载
    积分:1
  • Sound-detection-size-Android
    Android检测声音大小代码及其解释说明,很多吹气球的游戏就是基于此类。(Size Android code and detecting sound explanation, a lot of blowing the game is based on the type of balloon.)
    2011-06-29 15:38:58下载
    积分:1
  • Chess
    一款基于android开发的小软件,中国象棋,简单实用,是开发者学习的好例子(A small software based on the android development, Chinese chess, simple and practical, a good example for developers to learn)
    2012-08-01 12:18:27下载
    积分:1
  • ITyiiWeb
    一个网站,能模拟网上数据收费式的上传下载( a web )
    2014-09-02 14:21:46下载
    积分:1
  • 简单的考试程序
    资源描述简单的考试系统,在一个界面中显示题库中的问题,选项,并且判断你做的是否正确,做对得分,做错不扣分!
    2023-02-28 05:55:04下载
    积分:1
  • PlantsVSZombies
    android植物大战僵尸,有基本的植物和僵尸(android plants vs zombies src)
    2015-07-17 10:38:39下载
    积分:1
  • JavaOpenGL
    it is a book java open GL for android. Book for beginner.
    2012-05-14 22:59:04下载
    积分:1
  • 696518资源总数
  • 104388会员总数
  • 18今日下载