incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Braden Shepherdson (JIRA)" <>
Subject [jira] [Commented] (CB-1250) Speed up fetching of contacts on Android
Date Thu, 16 Aug 2012 21:25:38 GMT


Braden Shepherdson commented on CB-1250:

So, good news and bad news.

First, the stock Android contacts app is surprisingly complex, 75k lines. I can't figure out
where it actually loads the contacts' names for the main browsable list.

Second, removing all JSON* creation and everything else from the loop over the contacts, and
replacing it with just add()ing the displayNames to an ArrayList<String> only changes
the runtime a bit. There's something else going on.

Much simpler than the real contacts app, one of the sample apps shipped with the SDK can load
a list of my contacts' names quickly, so I'll be examining that to see why it works fast.
It uses SimpleCursorAdapter, which I've never encountered before. I've been digging through
that code trying to figure out how this tangle of ViewBinders and *Adapters eventually results
in a ListView full of TextViews with the contacts' names. Hopefully once I figure it out we
can duplicate that approach or see what's making our approach slow. We know now that it's
not the contents of the loop, but something more general in this technique.
> Speed up fetching of contacts on Android
> ----------------------------------------
>                 Key: CB-1250
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Braden Shepherdson
>            Assignee: Joe Bowser
>            Priority: Minor
>             Fix For: 2.1.0
> Fetching all contacts on Android takes a long time when the user has many contacts (I
have ~1450 and it takes 20-30 seconds). The Contacts app can load in less than a second, so
what are we doing that's causing it to slow down?
> As an alternative or additional enhancement, add "limit" and "offset" functionality to
the ContactFindOptions, to retrieve smaller subsets of the contacts more quickly.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message