Android Question xCustomListView Optimize Speed

Discussion in 'Android Questions' started by scsjc, Jul 5, 2019.

  1. scsjc

    scsjc Well-Known Member Licensed User

    Hi all,

    Until now I used SearchView to load a list of clients, and select the client and the performance was pretty good.

    Today I have been "playing" with the new available options ... "xCustomListView" and also with "CLVIndexScroller", well the performance is not so good, and the speed is slow in loading. (I removed "CLVIndexScroller" to see if it was the fault of this code, and I do not notice any difference either.

    I would like to know if anyone can tell me some way to optimize this code that I attached to speed up the visualization process.

    Thank you very much to all.


    Attached Files:

  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Hello @scsjc,
    I have 2 questions for you.

    1. Why do you need to load 7089 items into the list at once, there's no need for that?
    2. Why are you not using lazy loading
    I'm just wondering as nobody ever needs to scrool down 7k+ items. You might be better of loading A-Z filters as and when they are actually needed. Load the data as it's needed, there's no need to populate the list fully from the very beginning...
    Erel likes this.
  3. LucaMs

    LucaMs Expert Licensed User

  4. scsjc

    scsjc Well-Known Member Licensed User

    I have clients who use the app, who have more than 5,000 clients, and that's needed the list, in order to select the client to create invoice.

    but it is true, the idea is wrong, visualizing all clients does not make sense, it is much better to write in a textbox and use a SearchView that starts looking from the 2nd character or 3rd character.

    Anyway, I had not seen the use of lazy loading, and it seems like a good idea.
  5. DonManfred

    DonManfred Expert Licensed User

    We have as much clients. No one here needs a complete list; no one want it! We do a search using a name, a address, a phonenumber, a customerid and then we do find the customer much more easier than using a list of 5000 Clients which one need to search manually.
    Erel and Peter Simpson like this.
  6. Peter Simpson

    Peter Simpson Expert Licensed User

    Example, I have a particular client who has slightly over 302,000 invoice and well over 557,000 quotes, I've just logged in to check. The mobile sales team uses an Android app that I developed for them, and no I do not load over 302k invoices or over 557k quotes into the xCLV's. I actually load the last 1000 invoices/quotes and then I use a modified version of the Lazy Loading to load the previous 1000 invoices/quotes to populate the xCLV's.

    Please note: 1000 lines takes in average time of 8/10th of a second in my apps to populate the xCLV's (each line has multiple labels to fill), this is using 4G mobile data.

    There is a 'Full Population' button that warns against and about the extra time it takes to load all invoices/quotes, all my bespoke apps manipulate active search filters to get users the list and information they require almost instantly (easily within 1 second using 4G).

    No, there's never ever a need to load thousands of lines into a list, never.

    Last edited: Jul 6, 2019
    DonManfred and scsjc like this.
  7. scsjc

    scsjc Well-Known Member Licensed User

    totally agree, yesterday when I was thinking about this, I did not realize that the simplest thing is as I was already doing.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice