public class

OfflineHelper

extends SQLiteOpenHelper
java.lang.Object
   ↳ android.database.sqlite.SQLiteOpenHelper
     ↳ com.kinvey.android.offline.OfflineHelper

Class Overview

This class manages a set of OfflineTables. This class is used by the OS to access sqllite, and delegates control to the appropriate OfflineTable.

Summary

Public Methods
List<String> getCollectionTables()
query the metdata table for a list of all collection tables, returning them as a list
GenericJson getEntity(AbstractClient client, AppData appData, String id)
Get an entity directly from an offline table
synchronized static OfflineHelper getInstance(Context context)
OfflineTable getTable(String collectionName)
Creates a new collection table, adds it to the metadata table, and returns it
void onCreate(SQLiteDatabase database)
Called by operating system when a new database is created.
void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion)
Called by operating system when a database needs to be upgraded
[Expand]
Inherited Methods
From class android.database.sqlite.SQLiteOpenHelper
From class java.lang.Object

Public Methods

public List<String> getCollectionTables ()

query the metdata table for a list of all collection tables, returning them as a list

Returns
  • a list of collection table names

public GenericJson getEntity (AbstractClient client, AppData appData, String id)

Get an entity directly from an offline table

Parameters
client - an instance of the client
appData - an instance of appdata
id - the id of the entity to return

public static synchronized OfflineHelper getInstance (Context context)

public OfflineTable getTable (String collectionName)

Creates a new collection table, adds it to the metadata table, and returns it

Parameters
collectionName - the collection to create a new table for

public void onCreate (SQLiteDatabase database)

Called by operating system when a new database is created.

public void onUpgrade (SQLiteDatabase database, int oldVersion, int newVersion)

Called by operating system when a database needs to be upgraded