Hi, The following code is getting all contact entries in my google
contact server, and show in listview of dialog
===========================================================
ContactsService m_ContactsService = null;
m_ContactsService = new ContactsService("ContactClient");
m_ContactsService.setUserCredentials("Username", "Password");
//Get contacts
ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri
("default"));
ContactsFeed feed = null;
feed = m_ContactsService.Query(query);
while (null != feed && feed.Entries.Count > 0)
{
foreach (ContactEntry entry in feed.Entries)
{
ListViewItem item = new ListViewItem
(entry.Title.Text);
listView1.Items.Add(item);
}
if (feed.NextChunk != null)
{
query = new ContactsQuery(feed.NextChunk);
feed = m_ContactsService.Query(query);
}
else
{
feed = null;
}
}
===========================================
I test this code in my smart phone, and I have about 100 contacts
when I start this program, It would use 564 KB memory
and during it getting all contacts, it would use 3.92 MB memory
I think when I use:
query = new ContactsQuery(feed.NextChunk);
feed = m_ContactsService.Query(query);
It does not free memory of old ContactsFeed.
Maybe it would need garbage collection?
Does anyone could told me how to do by some sample code?
Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---