Android的支票时表最后更新 [英] Android check when table was last updated

查看:108
本文介绍了Android的支票时表最后更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我开始开发将会使用一个SQLite数据库,将举行几个表一个Android应用程序。当特定的表的最后更新时间为某些数据并不需要说一个星期时,其它表将需要每隔几个小时进行更新要更新什么,我想知道的是。试图节省带宽和创造一个可以更快更敏感的应用程序。不知道是否有(似乎无法找到任何东西)这个命令或者我是否应该在每个表中与当前的时间和日期添加一个字段,并使用System.currentTimeMillis的()制定了有多久了。

Hi there I'm starting to develop an Android app which will be using a SQLite DB that will hold several tables. What I would like to know is when specific tables were last updated as some data would not need to be updated for say a week where as other tables will need to be updated every few hours. Trying to save bandwidth and create a faster more responsive app. Not sure if there is a command for this (can't seem to find anything) or if I should add a field within each table with the current time and date and use System.currentTimeMillis() to work out how long it has been.

我知道这是问以下,但从来没有回答,任何帮助将是真棒:)

I know this was asked below but was never answered, any help would be awesome :)

<一个href=\"http://stackoverflow.com/questions/7969219/check-when-an-sqlite-database-table-was-last-updated-php\">Check当一个SQLite数据库/表最后更新(PHP)

推荐答案

这是我所知道的是没有SQL函数来做到这一点。

That I know of there is no SQL function to do it.

您可以将字段添加到每个记录一个时间戳,然后做一个查询,以从表中返回最新的时间戳。

You could add a field to each record with a timestamp, then do a query to return the latest timestamp from the table.

这篇关于Android的支票时表最后更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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