Hi I need to speed this functions I don't know why is so slow. I gathering the data from a job, that download this file really fast, decode and put than on list.
but when I try to fill the listview its slow really slow.
this is a sample from the downloaded data :
all the files are in dirasset.
this is the trim_string2 function
but when I try to fill the listview its slow really slow.
this is a sample from the downloaded data :
B4X:
"title": "Rivalidad ministerial",
"date": "2016-07-10 11:15:34",
"thumb_url": "http:\/\/ibsj.org\/wp-content\/uploads\/2014\/10\/pastor-sugel.png",
"video_url": "https:\/\/www.youtube.com\/watch?v=tg2j20TP5YI",
"audio_url": "http:\/\/ibsj.org\/wp-content\/uploads\/2016\/07\/20160711Rivalidadministerial-SugelMichelen.mp3",
"author": "Sugel Michel\u00e9n"
all the files are in dirasset.
B4X:
For i = 0 To List1.Size -1
Dim pastor As String
If List2.Get(i) = "null" Or List2.Get(i) = 0 Then
Log("lista es vacia")
ListView1.AddTwoLinesAndBitmap( List6.Get(i),List4.Get(i),LoadBitmapSample(File.DirAssets,"play2.png",15dip,15dip))
Else
pastor = trim_string2(List2.Get(i))
If File.Exists(File.DirAssets,pastor) = True Then
Log(pastor)
Try
ListView1.AddTwoLinesAndBitmap( List6.Get(i),List4.Get(i),LoadBitmapSample(File.DirAssets,pastor,15dip,15dip))
Catch
Log(LastException)
End Try
Else
ListView1.AddTwoLinesAndBitmap( List6.Get(i),List4.Get(i),LoadBitmapSample(File.DirAssets,"play2.png",15dip,15dip))
End If
End If
Next
this is the trim_string2 function
B4X:
Sub trim_string2 (data As String) As String
Dim result As String
If data = "null" Or data.Length = 0 Then
Else
result = data.SubString2(43,data.Length)
Return result
End If
Return ""
End Sub