|
|
|
|
|
- Overview
- Managing the contacts while using the Contact variables
- Managing the contacts while using the Contact structure (kept for backward compatibility)
Managing contacts (mobile devices)
In your mobile applications, you can directly manage the contacts on your mobile device (Android, iPhone, iPad, etc.). To do so, WLanguage provides you with: - the Contact functions.
- advanced WLanguage variables: Contact, etc.
Note For compatibility, you can also use the mContact structure in 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.
Managing the contacts while using the Contact variables To manage the contacts found on the mobile device: - Declare a variable of type Contact. This type of variable is used to describe and find out all the characteristics of the contact found in the mobile device.
- 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:
gContactEnCours is Contact
gtabContacts is array of Contact
LooperDeleteAll(ZR_CONTACTS)
gtabContacts = ContactList()
IF gtabContacts.Count > 0 THEN
ArraySort(gtabContacts, asMember, "+Nom")
FOR EACH tContact OF gtabContacts
LooperAddLine(ZR_CONTACTS, ...
tContact.Nom, tContact.Prénom)
END
LIB_NBContacts = StringBuild("%1 contacts", gtabContacts.Count)
END
- To directly handle the contacts with the native application of the phone, use the following functions:
| | ContactCreate | Displays the contact creation window of the device's native contact management application (Android, iPhone or iPad). | ContactDisplay | Opens the form of a contact in the native application for contact management of the device (Android, iPhone or iPad). | ContactEdit | Opens a contact's current file in the device's native contact management application (Android, iPhone or iPad). | ContactSelect | Displays the list of contacts found on the device (Android, iPhone or iPad). |
- Several WLanguage functions are used to perform all the possible operations:
| | ContactAdd | Adds a contact: - in a Lotus Notes or Outlook address book.
- in the contacts list of your device (Android, iPhone or iPad).
| ContactDelete | Deletes the current contact: - from a Lotus Notes or Outlook address book.
- in the Phone contacts list (Android, iPhone or iPad).
| ContactListSource | Lists the sources (or accounts) of the contacts saved on the device. | ContactModify | Modifies the current contact in a Lotus Notes or Outlook address book. | ContactReset | Reinitializes: |
Related Examples:
|
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:
| | ContactFirst | Reads the first contact in a Lotus Notes or Outlook address book. | ContactLast | Reads the last contact in a Lotus Notes or Outlook address book. | ContactNext | Reads the contact after the current contact in a Lotus Notes or Outlook address book. | ContactPrevious | Reads the contact before the current contact in a Lotus Notes or Outlook address book. | ContactRead | Reads a contact in a Lotus Notes or Outlook address book. |
The mContact.Out variable is used to find out whether a current record exists. - Handle the current contact with the following functions:
| | ContactAdd | Adds a contact: - in a Lotus Notes or Outlook address book.
- in the contacts list of your device (Android, iPhone or iPad).
| ContactDelete | Deletes the current contact: - from a Lotus Notes or Outlook address book.
- in the Phone contacts list (Android, iPhone or iPad).
| ContactDisplay | Opens the form of a contact in the native application for contact management of the device (Android, iPhone or iPad). | ContactEdit | Opens a contact's current file in the device's native contact management application (Android, iPhone or iPad). | ContactModify | Modifies the current contact in a Lotus Notes or Outlook address book. | ContactRead | Reads a contact in a Lotus Notes or Outlook address book. | ContactReset | Reinitializes: | ContactSearch | Searches for a contact in a Lotus Notes or Outlook address book. | ContactSelect | Displays the list of contacts found on the device (Android, iPhone or iPad). |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|