2

My app creates a contact item that is used to communicate images to the application via a timeline subscription.

When I am deleting contacts via the REST API I am getting a success status and when I list the contact items via the REST API I can verify that the contact is removed.

But on the device itself the contact is still there. Only when I shutdown and startup the device the contact is gone. How can I make that happen immediately after my request?

My Device info: XE9 up to date. The device has a connection and I can update/delete timeline items without any problem.

Alain
  • 6,044
  • 21
  • 27
Stan Wiechers
  • 1,962
  • 27
  • 45
  • 1
    Following up on issue tracker: https://code.google.com/p/google-glass-api/issues/detail?id=193 – Alain Sep 10 '13 at 22:32

1 Answers1

0

Deletion of contacts can happen by your Glassware only if those contacts were inserted into your Glass by the same Glassware.

I have tried this DeleteAllContacts code, that works pretty well.

NewUserBootstrapper.deleteAllContacts(MirrorClient.getMirror(credential), credential);

and this is the method.

private static void deleteAllContacts(Mirror service, Credential credential) 
{
try {
    ContactsListResponse contacts = service.contacts().list().execute();
    for (Contact contact : contacts.getItems())
    {
        LOG.info("Contact ID: " + contact.getId());
        LOG.info("  > displayName: " + contact.getDisplayName());
        if (contact.getImageUrls() != null) {
            for (String imageUrl : contact.getImageUrls()) {
                LOG.info("  > imageUrl: " + imageUrl);
            }
        }
        MirrorClient.deleteContact(credential, contact.getId());
     }
  }catch (IOException ioe) {
      LOG.warning("An error occurred: " + ioe.getMessage());
 }

}

  • Yes, the app is removing contacts that it actually created. I only see the contacts removed when I turn glass off and on again. – Stan Wiechers Sep 19 '13 at 11:27
  • Do you also need to reboot your glass, in-order to get timeline cards pushed from your Glassware. Is your Glassware deployed on Google App Engine, if not I would recommend that. – Dev Srivastava Sep 19 '13 at 18:16