PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to manage the Google contacts?
  • Managing the Google contacts
  • Creating a Google contact
  • Note
  • How to retrieve a Google contact?
  • How to modify or delete the Google contacts?
  • Principle
  • Modifying a contact
  • Deleting a contact
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The Google Contact service is used to manage contacts on Internet. WINDEV and WEBDEV allow you to create an application for synchronizing the contacts of an existing program with the contacts of Google Contact.
Warning: Before using a feature linked to Google services, we strongly recommend that you check the license for using this service. Some restrictions may apply. The content of licenses may change over time.
PC SOFT is in no case responsible for the way the native access functions are used. Make sure that you comply with the license of service provider.
How to manage the Google contacts?

Managing the Google contacts

To manage the Google contacts:
  1. Create a Google account if necessary. This account can be created via the following address: http://code.google.com/intl/en/apis/maps/signup.html. Caution: the address of this page may have been modified since the publication date of this page.
    The Google account is identified by an email address and the associated password.
  2. In the code of your application, create a gglConnection variable. This variable contains the characteristics of the connection to your Google account.
Caution: the access to the Google Contacts changes from November 17, 2014
From November 17 2014, Google is only using the Google API version 3 (Google API version 2 is abandoned). This change of version has modified the exchange format of data used by the functions for accessing the Google Contacts.
An "OAuth 2.0" authentication is now required to access this service. This authentication mode requires:
  • the declaration of the application in the Google console. To use the Google Contacts, the application must use the "Contacts API" service.
  • the use of new properties in the gglConnection variable.
See the help about GglConnect for more details.
Caution: The gglCalendar, gglEvent and gglLocation variables are also modified. Some properties become obsolete with the Google API version 3: they must not be specified anymore.

Creating a Google contact

A Google contact can be created via the Google interface or by programming with the WLanguage functions.
To create a Google contact with the WLanguage functions:
  1. Create a gglContact variable.
  2. Define the characteristics of the contact with the gglContact properties.
  3. Validate the creation of the contact with GglWrite.

Note

If you are using a proxy to access Internet, the proxy must be configured (Proxy) to use the Google functions.
How to retrieve a Google contact?
To retrieve a Google contact:
  1. Declare an array of gglContact variables.
  2. Use GglListContact. This function is used to list the contacts. The contacts found are assigned to the array of gglContact variables.
Example:
// Retrieves all the contacts
arrContacts is array of 0 gglContact
arrContacts = GglListContact(Cnt)
// Browse the contacts
MyContact is gglContact
FOR EACH MyContact OF arrContacts
Trace(MyContact..Name)
END
How to modify or delete the Google contacts?

Principle

The principle is straightforward: You must find the contact to modify or to delete and you must position on this contact before performing the requested operation.

Modifying a contact

To modify a contact:
  1. Retrieve the list of contacts.
  2. Find the contact to modify.
  3. Modify the characteristics of the contact.
  4. Validate the modifications with GglWrite.
Example:
// Retrieves all the contacts
arrContacts is array of 0 gglContact
arrContacts = GglListContact(Cnt)
// Browse the contacts
MyContact is gglContact
FOR EACH MyContact OF arrContacts
IF MyContact..Name = "MOORE" THEN
MyContact..PostalAddress[1]..Address = "34000 Montpellier"
// Actually update the changes on the server
GglWrite(Cnt, MyContact)
END
END

Deleting a contact

To delete a contact:
  1. Retrieve the list of contacts.
  2. Find the contact to delete.
  3. Delete the contact with GglDelete.
Example:
// Retrieves all the contacts
arrContacts is array of 0 gglContact
arrContacts = GglListContact(Cnt)
// Browse the contacts
MyContact is gglContact
FOR EACH MyContact OF arrContacts
IF MyContact..Name = "MOORE" THEN
// Deletion
GglDelete(Cnt, MyContact)
END
END
Related Examples:
Accessing the Google contacts Unit examples (WINDEV): Accessing the Google contacts
[ + ] Using the gglXxx functions to access the contacts defined in your Google account.
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment