I tried with picasso and DownloadImage in both cases reaches a certain point and drops the application for lack of memory, it seems impossible now to make a list with images loaded in b4a, I know UltimateListView exists that possibly solve this problem, but my concern is That with the available libraries not of payments at the moment it is not possible to realize a list glan with images.
B4X:
Sub DownloadQuote
Dim j As HttpJob
j.Initialize("", Me) 'name is empty as it is no longer needed
j.Download("https://api.themoviedb.org/3/movie/upcoming?api_key=Api_Key&language=es-CL&append_to_response=images&include_image_language=es&page="&pagina)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
'The result is a json string. We parse it and log the fields.
Dim jp As JSONParser
Dim Map1 As Map
Dim quotes As List
jp.Initialize(j.GetString)
Map1 = jp.NextObject
quotes = Map1.Get("results")
For Each quot As Map In quotes
CustomList.Add(CreateListItem($"Item #${quot.Get("id")}"$, CustomList.AsView.Width, 70dip), 74dip, $"Item #${quot.Get("id")}"$)
LabelVotos.Text = quot.Get("vote_average")
LabelTitulo.Text = quot.Get("title")
'DownloadImage("https://image.tmdb.org/t/p/w500/"".Get("poster_path"), ImageView)
GetPicasso.RunMethodJO("load", Array("https://image.tmdb.org/t/p/w500/"".Get("poster_path"))).RunMethodJO("into", Array(ImageView))
Next
End If
j.Release
ProgressDialogHide
End Sub
B4X:
Refresh started
Refresh stopped
java.lang.OutOfMemoryError: Failed to allocate a 20 byte allocation with 0 free bytes and 3GB until OOM
at com.squareup.picasso.Dispatcher.performBatchComplete(Dispatcher.java:380)
at com.squareup.picasso.Dispatcher$DispatcherHandler.handleMessage(Dispatcher.java:516)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)