Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting heavy data throws Cursor Window: Window is full error

I am new to android and in my app I have to fetch heavy data from server (out of which two are images) and store it in local database. Till now, I have done standard way which involves fetching all data at once and storing it in local database. But I am getting out of memory error. Is there any guidelines which I need to follow while fetching heavy data? Also I am storing images in local database in blob form.

like image 649
Scan Game Avatar asked Feb 08 '16 10:02

Scan Game


1 Answers

I think this is because query results are too large for the cursor's window and it requests more memory or caused because of blob image .

Since your requirement met using endless scroll or infinite scroll I recomment to use that .

And best way to store image is to store path in DB and store image in SD card

You will get reference from following link to implement infinite scroll view using recycler view

http://android-pratap.blogspot.in/2015/06/endless-recyclerview-with-progress-bar.html

like image 112
Rahul Avatar answered Oct 15 '22 13:10

Rahul