public class DatabaseAdapter
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DatabaseAdapter.Table |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
addJSON(JSONObject j,
DatabaseAdapter.Table table,
java.lang.String token)
Adds a JSON string representing an event with properties or a person record
to the SQLiteDatabase.
|
void |
cleanupEvents(DatabaseAdapter.Table table,
java.lang.String token) |
void |
cleanupEvents(long time,
DatabaseAdapter.Table table)
Removes events before time
|
int |
cleanupEvents(java.lang.String last_id,
DatabaseAdapter.Table table,
java.lang.String token)
Removes events with an _id <= last_id from table
|
java.lang.String[] |
generateDataString(DatabaseAdapter.Table table,
java.lang.String token,
int limit)
Returns the data string to send to the server and the maximum ID of the row that we are sending,
so we know what rows to delete when a track request was successful.
|
public int addJSON(JSONObject j,
DatabaseAdapter.Table table,
java.lang.String token)
j - the JSON to recordtable - the table to insert intotoken - the token this event belongs topublic int cleanupEvents(java.lang.String last_id,
DatabaseAdapter.Table table,
java.lang.String token)
last_id - the last id to deletetable - the table to remove events fromtoken - the project token; if null, delete all related events.public void cleanupEvents(DatabaseAdapter.Table table, java.lang.String token)
public void cleanupEvents(long time,
DatabaseAdapter.Table table)
time - the unix epoch in milliseconds to remove events beforetable - the table to remove events frompublic java.lang.String[] generateDataString(DatabaseAdapter.Table table, java.lang.String token, int limit)
table - the table to read the JSON fromtoken - the token of the project you want to retrieve the records forlimit - the maximum number of rows returned.