iOS Question Customlist from the internet

Sasuke Sama

Active Member
Licensed User
Hi
I have a json file acting as a database
it contains info that i want to show in a custom cards list
i can handel the texts as they are small in size but what about the images?
do i have to download each one of them? my list is about 600 item so i dont think thats a good option i also cant use a tableview for the same reason so my only option i think would be customlist lazyloading
i saw the cards as list example and it looks good but the problem is that it uses local photos
can someone tell me where to start? thanks
 

Sasuke Sama

Active Member
Licensed User
How large are the image files?
Not much about 20-30 kb each
I can display an image without storing it to the device using
B4X:
Imageview1.bitmap=j.getbitmap
If only i can combine this with the lazyloading
 

Erel

Administrator
Staff member
Licensed User
I can display an image without storing it to the device using
It doesn't matter if you store it or not. The bottleneck is downloading the image over the internet. This can take a few seconds and might be too slow for the image to appear while the user scrolls the list.

Example with ImageSlider downloading images over the internet: https://www.b4x.com/android/forum/t...sing-when-the-slider-is-on.95779/#post-604705

If the internet connection is fast enough then you can do it with lazy loading. Just make sure not to send multiple requests to the same image.

Worth checking the size of all images compressed as a zip file.
 

Sasuke Sama

Active Member
Licensed User
It doesn't matter if you store it or not. The bottleneck is downloading the image over the internet. This can take a few seconds and might be too slow for the image to appear while the user scrolls the list.

Example with ImageSlider downloading images over the internet: https://www.b4x.com/android/forum/t...sing-when-the-slider-is-on.95779/#post-604705

If the internet connection is fast enough then you can do it with lazy loading. Just make sure not to send multiple requests to the same image.

Worth checking the size of all images compressed as a zip file.
i think i got things out i only need two more things :
i want to show the items once they created ... right now the lazyloading example fills the list first then show all of them.
second is it posable to create the list with empty images then put an image on the current visible imageview
 
Last edited:

Sasuke Sama

Active Member
Licensed User
Yes, it is possible. You will need to update the items once the images are available.

I recommend you to create all items, with their layouts, when the app starts. Only download and update the images while the user scrolls.
Yes i did created the layouts and downloaded the images but im not sure how to update the layouts to add the images
 

Sasuke Sama

Active Member
Licensed User
Check this (old) example: https://www.b4x.com/android/forum/threads/class-imagedownloader.51862/#post-441197

Note that is uses the old CustomListView class.
after days of trying and searching i couldnt get it :(
here is my project ( im using the cardslist example as a base) if you or anyone could only modify my project and make the images download and display on the views when the user is scrolling i would be very very very thankful
the project already dose download and put images but dosent work correctly for some reason
 

Attachments

Top