Hi All,
I have an app that stores it's local data in a database, The database has a
TEXT field called description that on some rows is truncated on retrieval. I
have checked the database by running it app in the emulator and grabbing the
database and checking the contents. So I know the data is there. I retrieve
it using:
public Cursor getAdditiveByRowID(long rowId) throws SQLException
{
Cursor mCursor =
db.query(true, Additives.DATABASE_TABLE, new String[] {
Additives.KEY_ROWID,
Additives.KEY_IDENTIFIER,
Additives.KEY_NAME,
Additives.KEY_TYPE,
Additives.KEY_DESCRIPTION,
Additives.KEY_ACKNOWLEDGEMENT,
Additives.KEY_WARNING
},
Additives.KEY_ROWID + "=" + rowId,
null,
null,
null,
null,
null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
When I use it the code looks like this:
if (cursor.moveToPosition(position))
{
Log.i(TAG,"contents from cursor =
"+cursor.getString(Additives.DESCRIPTION_COLUMN));
......
record.setDescription(cursor.getString(Additives.DESCRIPTION_COLUMN));
......
}
I checked the output and it appears to be truncating the output at various
stages (one it is 1980 chars before truncating and another it is 257 chars)
with some rows only. I checked for bad chars but as I thought, it was fine
(the same database is used in my iPhone app with no problems) So it must be
something I am doing. But I can not see where as it is wrong as soon as it
comes from the database. Any assistance or advice to debug this would be more
than helpful.
I have also checked the length (Thanks Frank) incase logcat is truncating the
strings and found this is not the issue. It reports the length that is
printed. I am stumped. I assume that others have extracted large strings from
sqlite under android as I have some rows which are larger than the ones being
truncated that return all the data as they should.
Regards
Damien
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en