Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm using your code from Corporate Addressbook to try to get a list of mails from my gmail account. But I'm stuck, this is what I'm doing:
- 1. Sending FolderSync request:
- <code>
- String uri = mUri + "FolderSync";
- String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
- + "<FolderSync xmlns=\"FolderHierarchy:\">\n" +
- "\t<SyncKey>0</SyncKey>\n"
- + "</FolderSync>";
- </code>
- 2. This is the response I get back. So far so good
- <code>
- <?xml version="1.0" encoding="utf-8" ?>
- <FolderSync xmlns="FolderHierarchy">
- <Status>1</Status>
- <SyncKey>1311783116298</SyncKey>
- <Changes>
- <Count>14</Count>
- ...
- <Add>
- <ServerId>Mail:^sync_gmail_group</ServerId>
- <ParentId>0</ParentId>
- <DisplayName>[Gmail]</DisplayName>
- <Type>12</Type>
- </Add>
- <Add>
- <ServerId>Mail:DEFAULT</ServerId>
- <ParentId>0</ParentId>
- <DisplayName>Inbox</DisplayName>
- <Type>2</Type>
- </Add>
- ...
- </Changes>
- </FolderSync>
- </code>
- 3. Now I take the ServerId for Inbox (Mail:DEFAULT) and do a Search Request
- <code>
- String uri = mUri + "Search";
- String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<Search xmlns=\"Search:\" xmlns:airsync=\"AirSync:\" xmlns:email=\"Email:\" xmlns:contacts=\"Contacts:\" >\n" +
- "<Store>\n" +
- "<Name>Mailbox</Name>\n" +
- "<Query>\n" +
- "<And>\n" +
- "<airsync:CollectionId>Mail:DEFAULT</airsync:CollectionId>\n" +
- "<FreeText>mail</FreeText>\n" +
- "</And>\n" +
- "</Query>\n" +
- "</Store>\n" +
- "</Search>";
- </code>
- 4. Here is where I get stuck. I get no e-mails in the response just a status 3 error.
- <code>
- <?xml version="1.0" encoding="utf-8" ?>
- <Search xmlns="Search">
- <Status>3</Status>
- </Search>
- </code>
- Could you please help me. Thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement