Ever since I moved my data from ArrayList to a sqlite database on Android, I have a serious performance drop. There are no cursors left open that could cause that, so I suspect that the problem is with the images I store in a BLOB field.
The application creates Cards that have a field cardBitmap that gets populated with a bitmap upon creation.
Can anyone tell me from their experience, what solution is more performant:
- cardBitmap holds a reference (path) to a file on SDcard that will be drawn upon creation. Only path is stored in DB.
- cardBitmap holds an object (BitmapFactory.decodeStream(imageStream,null,null)), where imageStream is read as a ByteArrayInputStream from the corresponding database field.
Any suggestions would be helpful. Thanks!
Your first solution is better one, Use a file from sdcard and store the reference path in your sqlite database, This gives you faster performance and also your database is remain light weight.