Beginner Question about the demo app

166 views
Skip to first unread message

Bruno Alexandre

unread,
Oct 26, 2010, 5:09:01 AM10/26/10
to isc...@googlegroups.com

I'm using jQT a lot for building my webapps, but a co-worker has an Android 2.2 (HTC Desire) mobile and the scroll is not that fluid on is mobile (works lovely on iPhone 3G and 4).

So as I know iScroll from some time, I went to the main website and fired up the demo.


Works great on iPhone, but on the HTC Desire it's not that smooth. It starts to be but it stops the scrolling momentum and for quite a few times, it just stops everything, then starts again like nothing had happen...


I just uploaded a simple Video of it to YouTube


Just to know if there are any problem with this or this is the top we can achieve on an Android device?


Thank you for the time.



Bruno Alexandre

[web] www.balexandre.com
[twitter] http://twitter.com/balexandre
 
 

Bruno Alexandre

unread,
Oct 26, 2010, 5:26:34 AM10/26/10
to isc...@googlegroups.com
P.S.

No idea how to upload the correct placement Video as I used the "Movie Rotator" (www.movierotator.com) as well the Rotate Video iPhone App (http://itunes.apple.com/us/app/rotate-video/id351487953?mt=8), and they do the job, but soon I upload it to YouTube, it shows the original placement.

please be kind.

Bruno Alexandre

unread,
Oct 28, 2010, 2:17:29 AM10/28/10
to isc...@googlegroups.com
No one to help me? :(

Matteo

unread,
Oct 28, 2010, 2:43:39 AM10/28/10
to iScroll
The Android browser is not HW accelerated, there's very little we can
do about it. You best bet is to remove the scrollbar/momentum/bounce
on android.
Also remember that Android 2.2 supports native position:fixed, so
actually no need of iscroll on that device.

Cheers
Matteo



On Oct 28, 8:17 am, Bruno Alexandre <bruno.in...@gmail.com> wrote:
> No one to help me? :(
>
> *
>
> Bruno Alexandre*
> On Tue, Oct 26, 2010 at 11:26 AM, Bruno Alexandre <bruno.in...@gmail.com>wrote:
>
>
>
>
>
>
>
> > P.S.
>
> > No idea how to upload the correct placement Video as I used the "Movie
> > Rotator" (www.movierotator.com) as well the Rotate Video iPhone App (
> >http://itunes.apple.com/us/app/rotate-video/id351487953?mt=8), and they do
> > the job, but soon I upload it to YouTube, it shows the original placement.
>
> > please be kind.
>
> > *
>
> > Bruno Alexandre*
> > On Tue, Oct 26, 2010 at 11:09 AM, Bruno Alexandre <bruno.in...@gmail.com>wrote:
>
> >> I'm using jQT a lot for building my webapps, but a co-worker has an
> >> Android 2.2 (HTC Desire) mobile and the scroll is not that fluid on is
> >> mobile (works lovely on iPhone 3G and 4).
>
> >>  So as I know iScroll from some time, I went to the main website and fired
> >> up the demo.
>
> >>http://cubiq.org/dropbox/iscroll/index.html?v=3.7.1
>
> >> Works great on iPhone, but on the *HTC Desire* it's not that smooth. It
> >> starts to be but it stops the scrolling momentum and for quite a few times,
> >> it just stops everything, then starts again like nothing had happen...
>
> >> I just uploaded a simple Video of it to YouTube
> >>http://www.youtube.com/watch?v=NJrf_ZwG-tM
>
> >> Just to know if there are any problem with this or this is the top we
> >> can achieve on an Android device?
>
> >> Thank you for the time.
>
> >> *
>
> >> Bruno Alexandre*

Luke Moody

unread,
Nov 1, 2010, 8:12:17 AM11/1/10
to iScroll
Hi guys,

I've been using iScroll for a while now, but it wasn't until the other
day when I noticed the issues on the HTC Desire. I've managed to have
a work around (thanks to DDMS!), and details are below:

Just as a quick recap, what was happening was that at some points, the
webview would just freeze. It was usually after scrolling (not
natively, but with iScroll), and sometimes after initialising a
touchmove event on an element not within the iScroll wrapper. In DDMS,
I noticed that there were two messages popping up every time this
happened. The first happened on all touchend events, the second when
it crashed:

11-01 11:35:56.007: WARN/webview(1503): Miss a drag as we are waiting
for WebCore's response for touch down.
11-01 11:31:28.945: DEBUG/webkit-timers(1503):
[JWebCoreJavaBridge::pause] >> do pause

The first one was a red-herring, and wasn't causing any noticable
problems. The second, however, was the cause of the crash.

Looking at the JWebCoreJavaBridge.java file here, it seems that WebKit
has a collection of timers that (for want of a better description)
time stuff. They seem to listen out for webkit events (like touch
events, transition events, etc), and if these timers are paused, no
webkit events are detected at all; so it's not so much of a crash as
WebKit deciding to stop listening.

I noticed that these timers were resumed after a touchend event
(paused on touchmove), and so getting them to resume again was pretty
important. In my code, I had:
document.addEventListener('touchmove', stopMove, false);
Where 'stopMove' was a function that just called e.preventDefault();.
Removing this fixed the issue with the timers not resuming when doing
a touchmove event on elements not within the iScroll wrapper.

Aaaanyway, onto the iScroll issue (!); I'm using the latest version of
iScroll for the line number references. On lines 64 - 66, the start/
move/end listeners are all added at the same time. I removed the move/
end listeners and put them in the touchstart function (just like how
NoClickDelay does it). I removed ALL the touch listeners on touchend
and added them again at the end of the resetPosition() function. I did
this because when iScroll was 'doing the momentum' transition, the HTC
Desire hates having touchevents registering, and this was what was
causing the JWebCoreJavaBridge to 'do pause'. In some ways, it's a
compromise because now I can't stop a momentum scroll once it's
happening, but it all depends on how 'native' iScroll on Android has
to be. Removing momentum, of course, will stop all of this happening,
and is a much quicker fix. Still, it was an interesting adventure!

Hope this helps someone, and apologies for the length :)

Cheers,
Luke.
> > >> Android 2.2 (HTCDesire) mobile and the scroll is not that fluid on is
> > >> mobile (works lovely on iPhone 3G and 4).
>
> > >>  So as I know iScroll from some time, I went to the main website and fired
> > >> up the demo.
>
> > >>http://cubiq.org/dropbox/iscroll/index.html?v=3.7.1
>
> > >> Works great on iPhone, but on the *HTCDesire* it's not that smooth. It

Matteo

unread,
Nov 4, 2010, 5:20:19 AM11/4/10
to iScroll
Nice finding and very good report, thanks. I'll dig deeper into it. I
have a couple of ideas to have the "stop the momentum" working in your
scenario.

keep in touch
Matteo
> > TheAndroidbrowser is not HW accelerated, there's very little we can
> > do about it. You best bet is to remove the scrollbar/momentum/bounce
> > onandroid.
> > Also remember thatAndroid2.2 supports native position:fixed, so
> > actually no need of iscroll on that device.
>
> > Cheers
> > Matteo
>
> > On Oct 28, 8:17 am, Bruno Alexandre <bruno.in...@gmail.com> wrote:
>
> > > No one to help me? :(
>
> > > *
>
> > > Bruno Alexandre*
> > > [web]www.balexandre.com
> > > [twitter]http://twitter.com/balexandre
>
> > > On Tue, Oct 26, 2010 at 11:26 AM, Bruno Alexandre <bruno.in...@gmail.com>wrote:
>
> > > > P.S.
>
> > > > No idea how to upload the correct placement Video as I used the "Movie
> > > > Rotator" (www.movierotator.com) as well the Rotate Video iPhone App (
> > > >http://itunes.apple.com/us/app/rotate-video/id351487953?mt=8), and they do
> > > > the job, but soon I upload it to YouTube, it shows the original placement.
>
> > > > please be kind.
>
> > > > *
>
> > > > Bruno Alexandre*
> > > > [web]www.balexandre.com
> > > > [twitter]http://twitter.com/balexandre
>
> > > > On Tue, Oct 26, 2010 at 11:09 AM, Bruno Alexandre <bruno.in...@gmail.com>wrote:
>
> > > >> I'm using jQT a lot for building my webapps, but a co-worker has an
> > > >>Android2.2 (HTCDesire) mobile and the scroll is not that fluid on is
Reply all
Reply to author
Forward
0 new messages