如何从Android上的数据库中读取? [英] How to read from a database on Android?

查看:188
本文介绍了如何从Android上的数据库中读取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的数据库和已经经历各种教程,但他们都教我如何创建数据库,并插入并从中取出。我已经有我不会需要改变,只是从中读取data.db文件。第一列是日期和时间,其余的都有关的信息,然后发生了什么事。用户输入的开始时间和结束时间,它们有兴趣,或选择所有,并以图形方式显示该数据。
我该怎么做呢这个数据库方面?用什么方法,我需要考虑?

I'm new to databases and have been going through various tutorials, but they all teach me how to create databases, and insert and remove from them. I already have a data.db file that I will not need to change, only read from it. The first column is a date and time, and the rest are information regarding what happened then. The user inputs a start time and end time that they are interested in, or selects all, and that data is displayed graphically. How do I do this database aspect of it? What methods do I need to look into?

推荐答案

这是一个很好的基础教程,可以帮助你 - 的 http://www.vogella.de/articles/AndroidSQLite/article.html#todo_database

This is a very good basic tutorial that might help you - http://www.vogella.de/articles/AndroidSQLite/article.html#todo_database

您应检查fetchAllTodos()和fetchTodo(长ROWID)功能,并尝试获取您的记录。你可以看得更远,看看如何约束添加到您的SQLite查询(类似WHERE的startTime> userStartTime和endTime< userEndTime)

You should inspect fetchAllTodos() and fetchTodo(long rowId) functions and try fetching your records. You could look further to see how to add constraints to your sqlite query (something like WHERE startTime > userStartTime AND endTime < userEndTime)

这篇关于如何从Android上的数据库中读取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆