Flutter DragAndDropGridView number of items preloaded - android

I'm using the Drag and Drop GridView flutter package to display a set of images selected via the gallery, when it initially loads, it loads the first 20 even though only 8 are visible, the rest load as we scroll down, however on some devices the 20 loaded, could cause the app to crash.
Is there a way to reduce the number of images loaded on the initial build?
We use a FutureBuilder to get the thumbnails of the images.

Related

Loading small jpeg files very quickly

I have implemented a custom version of bitmap loader. I have an auto scroll list of images
of movies. When the user presses and holds the d-pad i start scrolling the list at Speed 1. We have speed 2 and 3 which scroll the list very fast so I have to load the images very fast.
So I created a circular list to load 50 images first then based on the current position I load the 25 images and discard the older 25 images.
I also tried the Glide preload https://muyangmin.github.io/glide/int/recyclerview.html but this does not work well in speed 3 and shows empty tiles instead of images
When I am doing the profiling i am seeing that 395MB memory is used by FinalizerRefrenace
FinalizerReference is held by the bitmaps I am using.
How can I fix the memory leak? I tried calling the recycle when the user closed the seek, still no luck.
Images i have are very small in size, mostly 10kb. Why do they take 100 Mb in memory?
Is there any other library I can use to show these images on a fast scrolling list for android TV?

Creating a Facebook-like image upload interface on Android

I'm trying to replicate the functionality of Facebook's image upload. To briefly describe it you click the Photo button from the main screen of the app you are taken to an image picker that will let you select up to 30 images. Once selected the images load in some kind of list view that allows you to add a caption, remove the image from the list, or do some other Facebook-y things. If you scroll around the list can move very quickly, and if you only have 5-10 images you generally spend little to no time waiting for items to reload.
Right now I have a recycler view and am using Picasso to load the images from disk, resize them, and then display them. This works, but it's not smooth or fast. Even if I only have five or six images loaded they don't come up instantly if I scroll from the bottom back to the top. I have tried increasing the LRU Cache size in Picasso, but that didn't do anything at all. It seems like the scaled image isn't getting cached so it has to be scaled to fit the screen width every time. That's just my guess though.
Any suggestions on how to get this to run more smoothly?

Lazy Loading for GridView

I'm developing an Android app that is used to get Images and texts from the internet using JSON.
I want to display these images and texts in gridview using a lazy loading approach to avoid the out of memory exception.
Say that i need to display 100 items, I want to display only 20 items after opening the activity and when i scroll down, another 20 items will be loaded, and so on.
How can i achieve that?

Android loading many images into gridview

In one section of my app , I m showing images to 1024+ websites inside a gridview. When the images are not present on the devices they are downloaded with an async task and the image is saved in the data folder. The grid view has a section indexer, adapter and fast scroll associated with it.
However I have noticed that the app becomes really slow when I try to fast scroll to different positions in the app. A solution \[here\]\[1\] hints implementing a hashmap to store images. The total size of the images I have are around .3mb . Will storing the bitmap in the map help speed up the app ?

View Stub(Pagination) and Lazy loading of Images in android

In android mobile we have an default application Market, under submenu there is functionality called all applications. In this, first it shows only ten records in which it will display defalut image and text, then in back ground it will update images. When we scroll down (i.e., end of list) and it shows loading and then it loads next 10, images will load lazily.
How to acheive this senario.
Thanks in Adavance
Jayanth
In this, first it shows only ten
records in which it will display
defalut image and text, then in back
ground it will update images.
I have done this with my ThumbnailAdapter, though I want to rewrite it sometime in the next few months.
When we scroll down (i.e., end of
list) and it shows loading and then it
loads next 10, images will load
lazily.
I have done this with my EndlessAdapter.
Perhaps these will give you some ideas.

Categories

Resources