Since Android has different size of layout, the number of rows can be shown in the ListView is therefore variable, ideally, we need to perform API call like..
http://www.example.com/get_product?count=N&..
Where N = number of rows can be displayed in a given ListView + 10 items buffer for offscreen scrolling effect.
What would be best method to define the value of N in the app?
Try this:
If it doesn’t work because it need to first create the list to get a child, and you have the dp height of the listItem (could be if you use a custom layout), you could use