Tentatively, my app will be retrieving at least 86400 rows of data everyday, as we have a total of 10 channels, with each channel producing 8640 rows of data (1 row is inserted every 10 seconds throughout the day).
(Done on mobile at the moment due to some major limitations. Will be migrating these intense processing to a middleware somewhere in the future)
The problem now is halfway through the retrieval, my app will crash due to the 1MB size limit of the cursor. The following is the method that is used to do the retrieval.
public Cursor getUnconsolidatedReadings(String channelID) {
String[] channelIDs = {channelID};
db = this.getReadableDatabase();
String sqlRetrieve = "SELECT ChannelID, TimeStamp, ID, RMSCurrent, RealPower FROM Readings WHERE Consolidated = 0 AND ChannelID = ?";
Cursor cursor = db.rawQuery(sqlRetrieve, channelIDs);
return cursor;
}
Is there any better way to do such large data retrieval?