02-16-2013 01:34 PM
Hi, my app made it to the App World before I was able to get my hands on an actual device. (I just got one yesterday!)
While it felt a little sluggish even on the emulator, it turns out it's downright unusable on the Z10.
The app is called Snooby. It's a Reddit client. The biggest problem with the app right now (there are many...) is when there are more than like 10 comments, the comments section becomes VERY laggy. It seems like there's just not enough memory to process all the comments. Is that possible?
I'm not sure how I should go about debugging this issue. Any suggestions? When I load tons of posts on the Facebook app, I see that it scrolls perfectly smoothly... So I'm sure that the Z10 is more than capable of scrolling through a lot of data. I'm just looking for suggestions of what I may be doing wrong.
02-17-2013 10:47 AM
02-17-2013 01:14 PM
I assume you've got a div with overflow: scroll / auto like this
Change it to this....
That switches on Hardware Scrolling on the Z10
02-17-2013 01:49 PM
Do you mean -webkit-overflow-scrolling: -blackberry-touch?
Unfortunately, I've already got that style on the div that contains all my comments. I tried changing it to "touch" and that didn't seem to make a visible difference either.
02-17-2013 01:53 PM
Hmmm... I took my css and a couple other JS files out and loaded all my comments unformatted and it seems to be scrolling perfectly fine.
I will try taking them out one by one and identify a culprit. I'll keep this thread updated in case someone comes across the same problem.
02-17-2013 01:57 PM
It's definitely touch
This is a trick we learned at one of the sessions in Amsterdam
It seemed worth suggesting it
We were given an app to play with and there was a difference using that (we were learning about profiling etc)
PM me your email and I'll send you the notes - that'll probably help you work out what's going wrong
02-17-2013 02:40 PM
I just tried touch again to verify.. and there still doesn't seem to be visible difference from -blackberry-touch.
However, perhaps I'm describing the problem wrong... the scrolling -- when it scrolls -- is buttery smooth. It's beautiful. It just takes a while for the screen to re-render after scrolling. So... if it's a very long comment thread and I scroll very far down very quickly, I can see a blank page with no text as the app is re-drawing all the text on the screen. This is the case with and without css. However, with CSS it's even slower. Also, while the app is re-rendering post-scroll, the app is blocked and cannot be used at all.
02-17-2013 02:52 PM
An idea might be to use text-overflow to limit how much is displayed? If the user touches the thing take the overflow off and it expands to the full thing.
The other thing is how are you grabbing the data? If it's on display then you are likely making a lot of network calls which could cause a bottle-neck as well
02-17-2013 03:03 PM
I'm using bbui.js and the data is grabbed from reddit during the ondomready event, which is when the DOM is loaded and displayed to the user. I place a loading indicator on the screen as I wait for a response from Reddit and load all the comments accordingly, and then I hide the loading indicator and show the comments.