PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Managing the contacts while using the Contact variables
  • Managing the contacts while using the Contact structure (kept for backward compatibility)
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
In your mobile applications, you have the ability to directly manage the contacts of your mobile device (Android, iPhone, iPad, Universal Windows).
To do so, the WLanguage proposes:
  • the Contact functions.
  • the advanced variables of WLanguage: Contact, ...
Note: For backward compatibility, you also have the ability to use the mContact structure of WLanguage. This solution is not recommended and it should only be used for the applications that operate with a version earlier than Android 2.0.
Versions 18 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 18
iPhone/iPad This feature is now available for the iPhone/iPad applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Versions 22 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 22
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Managing the contacts while using the Contact variables
To manage the contacts found on the mobile device:
  1. Declare a Contact variable. This type of variable is used to describe and find out all the characteristics of the contact found in the mobile device.
  2. Use the WLanguage functions according to the requested action:
    • To read and display in your application the contacts found in the mobile device, use ContactList. This function fills an array of Contact variables. This enables you to browse the array of variables in order to add the different contacts into a looper. For example:
      gCurrentContact is Contact
      garrContacts is array of Contacts

      LooperDeleteAll(LOOP_CONTACTS)

      // List of contacts
      garrContacts = ContactList()

      IF garrContacts..Occurrence > 0 THEN
      // Sort the contacts
      ArraySort(garrContacts, asMember, "+Name")

      // Add into the looper
      FOR EACH tContact OF garrContacts
      LooperAddLine(LOOP_CONTACTS, ...
      tContact..Name, tContact..FirstName)
      END
      // Display the number of contacts
      STC_NbContacts = StringBuild("%1 contacts", ...
      garrContacts..Occurrence)
      END
    • To directly handle the contacts with the native application of the phone, use the following functions:
      ContactCreateDisplays the window for contact creation of the native application for contact management found on the device (Android, iPhone or iPad, Universal Windows).
      ContactDisplayOpens the form of a contact in the native application for contact management of the device (Android, iPhone or iPad, Universal Windows).
      ContactEditOpens the form of a current contact in edit mode in the native application for contact management found on the device (Android, iPhone, iPad, Universal Windows).
      ContactSelectDisplays the list of contacts found on the device (Android, iPhone or iPad, Universal Windows).
    • Several WLanguage functions are used to perform all the possible operations:
      ContactAddAdds a contact:
      • into the address book of a Lotus Notes or Outlook messaging.
      • into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
      ContactDeleteDeletes the current contact:
      • from the address book of a Lotus Notes or Outlook messaging.
      • from the list of contacts on the phone (Android, iPhone or iPad, Universal Windows).
      ContactListSourceLists the sources (or accounts) of the contacts saved on the device.
      ContactModifyModifies the current contact in:
      • the address book of a Lotus Notes or Outlook messaging.
      • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
      ContactResetReinitializes:
Related Examples:
WM Managing Contacts Cross-platform examples (WINDEV Mobile): WM Managing Contacts
[ + ] This example presents the management of contacts for Android et iOS.
It is used o:
- list the contacts found on the phone
- call the contacts
- send SMSs to the contacts
- ...
Managing the contacts while using the Contact structure (kept for backward compatibility)
Warning
From version 17 (69), this method is kept for backward compatibility. This method is not recommended and it should only be kept for the applications that use a version earlier than Android 2.0.
To manage the contacts of the mobile device, you have the ability to use the mContact structure. This structure is a preset structure of WLanguage used to handle a contact.
To handle the contacts found on the mobile device:
  • Browse the different contacts with the following functions:
    Versions 11 and later
    ContactFirst
    New in version 11
    ContactFirst
    ContactFirst
    Reads the first contact found in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad).
    Versions 11 and later
    ContactLast
    New in version 11
    ContactLast
    ContactLast
    Reads the last contact found in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactNext
    New in version 11
    ContactNext
    ContactNext
    Reads the contact found after the current contact in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactPrevious
    New in version 11
    ContactPrevious
    ContactPrevious
    Reads the contact found before the current contact in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactRead
    New in version 11
    ContactRead
    ContactRead
    Reads a contact found in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).

    The mContact.Out variable is used to find out whether a current record exists.
  • Handle the current contact with the following functions:
    Versions 11 and later
    ContactAdd
    New in version 11
    ContactAdd
    ContactAdd
    Adds a contact:
    • into the address book of a Lotus Notes or Outlook messaging.
    • into the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactDelete
    New in version 11
    ContactDelete
    ContactDelete
    Deletes the current contact:
    • from the address book of a Lotus Notes or Outlook messaging.
    • from the list of contacts on the phone (Android, iPhone or iPad, Universal Windows).
    Versions 16 and later
    ContactDisplay
    New in version 16
    ContactDisplay
    ContactDisplay
    Opens the form of a contact in the native application for contact management of the device (Android, iPhone or iPad, Universal Windows).
    Versions 16 and later
    ContactEdit
    New in version 16
    ContactEdit
    ContactEdit
    Opens the form of a current contact in edit mode in the native application for contact management found on the device (Android, iPhone, iPad, Universal Windows).
    Versions 11 and later
    ContactModify
    New in version 11
    ContactModify
    ContactModify
    Modifies the current contact in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactRead
    New in version 11
    ContactRead
    ContactRead
    Reads a contact found in:
    • the address book of a Lotus Notes or Outlook messaging.
    • the list of contacts on the device (Android, iPhone or iPad, Universal Windows).
    Versions 11 and later
    ContactReset
    New in version 11
    ContactReset
    ContactReset
    Reinitializes:
    Versions 11 and later
    ContactSearch
    New in version 11
    ContactSearch
    ContactSearch
    Finds a contact:
    • in the address book of a Lotus Notes or Outlook messaging.
    • in the list of contacts on the mobile device (Android, iPhone or iPad, Universal Windows).
    Versions 16 and later
    ContactSelect
    New in version 16
    ContactSelect
    ContactSelect
    Displays the list of contacts found on the device (Android, iPhone or iPad, Universal Windows).
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment