2
votes

I want to implement lazy loading in touch devices using LWUIT. On key devices I successfully implemented lazy loading using the keyDown() event of the device but on touch devices this not work.

When user scroll the list in touch device how can I know how much user scroll and how many item I have to add for visible area and remove item from the top of the list and add item at bottom of the list? Is there any method in LWUIT by using that I can check how much user scroll and how many item I have to visible?

And how can I detect how much component to visible because device to device scroll speed and how many component to visible is also change? If there is any method in LWUIT to find how many component should visible next when user drag then it can help.

1

1 Answers

2
votes

You should have used the list model to lazily load data and not the key events, that would have worked for everything. Look at the Makeover demo where we implemented lazy loading in the model layer.

Model entries that aren't visible won't be called in a list.

Eric Coolman wrote a great tutorial on how to do this in Codename One, for streaming the entries from Twitter.