Simulate a Contacts Database

Filter by IDE
Select the Progress AppBuilder client you are currently using for development.

IDE

In the simulator, you can test the Contacts core Apache Cordova plugin. You can clone and delete contacts in the simulator or manually edit the mock database and load it in the simulator.

In the device simulator, calls to the Contacts plugin from your code will run against the currently loaded mock database.

In the device simulator, the default contacts database contains 25 contacts and can contain up to 1000 contacts.

Prerequisites

  • Verify that your preferred AppBuilder client is running and you are logged in.
  • Verify that you have opened the code for your app in AppBuilder.
  • Verify that the simulator is running.

Procedure

In-Browser

In this version of the in-browser client, you cannot simulate the Contacts core plugin and you cannot interact with the contacts database in the device simulator.

Windows

AppBuilder stores an editable copy of the mock contacts database in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json. When you reload the default contacts, this file is overridden with the default contacts and all changes are lost.

  1. Click Show/Hide Contacts to open the Contacts pane.
  2. (Optional) Click a column title to sort the list of contacts.
  3. (Optional) Click Clone a contact (Clone) to duplicate a selected contact.
  4. (Optional) Click Edit a contact (Edit) to modify a selected contact.
    The Edit contacts pane opens. After you edit the contact, click Save to store the contact and return to the contacts database.
  5. (Optional) Click Delete a contact (Delete) to remove a selected contact.
  6. (Optional) Click Add to add a new contact to the database.
    The New contacts pane opens. After you complete the form, click Save to store the contact and return to the contacts database.
  7. (Optional) Click Remove all to delete all default contacts.
  8. (Optional) Load a custom mock database.
    1. Close the simulator.
    2. Open %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json for editing in a text editor.
    3. Modify the contacts database by manually adding, editing or removing entries.
    4. Save the file and close the text editor.
    5. Run the simulator and click Show/Hide Contacts.
  9. (Optional) Click Load default to restore the default contacts.
    This action refreshes the currently loaded contacts and overrides all changes in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json.

Visual Studio

AppBuilder stores an editable copy of the mock contacts database in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json. When you reload the default contacts, this file is overridden with the default contacts and all changes are lost.

  1. Click Show/Hide Contacts to open the Contacts pane.
  2. (Optional) Click a column title to sort the list of contacts.
  3. (Optional) Click Clone a contact (Clone) to duplicate a selected contact.
  4. (Optional) Click Edit a contact (Edit) to modify a selected contact.
    The Edit contacts pane opens. After you edit the contact, click Save to store the contact and return to the contacts database.
  5. (Optional) Click Delete a contact (Delete) to remove a selected contact.
  6. (Optional) Click Add to add a new contact to the database.
    The New contacts pane opens. After you complete the form, click Save to store the contact and return to the contacts database.
  7. (Optional) Click Remove all to delete all default contacts.
  8. (Optional) Load a custom mock database.
    1. Close the simulator.
    2. Open %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json for editing in a text editor.
    3. Modify the contacts database by manually adding, editing or removing entries.
    4. Save the file and close the text editor.
    5. Run the simulator and click Show/Hide Contacts.
  9. (Optional) Click Load default to restore the default contacts.
    This action refreshes the currently loaded contacts and overrides all changes in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json.

CLI

If you are running the command-line interface on a Windows system, perform the following steps.

On Windows systems, AppBuilder stores an editable copy of the mock contacts database in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json. When you reload the default contacts, this file is overridden with the default contacts and all changes are lost.

  1. Click Show/Hide Contacts to open the Contacts pane.
  2. (Optional) Click a column title to sort the list of contacts.
  3. (Optional) Click Clone a contact (Clone) to duplicate a selected contact.
  4. (Optional) Click Edit a contact (Edit) to modify a selected contact.
    The Edit contacts pane opens. After you edit the contact, click Save to store the contact and return to the contacts database.
  5. (Optional) Click Delete a contact (Delete) to remove a selected contact.
  6. (Optional) Click Add to add a new contact to the database.
    The New contacts pane opens. After you complete the form, click Save to store the contact and return to the contacts database.
  7. (Optional) Click Remove all to delete all default contacts.
  8. (Optional) Load a custom mock database.
    1. Close the simulator.
    2. Open %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json for editing in a text editor.
    3. Modify the contacts database by manually adding, editing or removing entries.
    4. Save the file and close the text editor.
    5. Run the simulator and click Show/Hide Contacts.
  9. (Optional) Click Load default to restore the default contacts.
    This action refreshes the currently loaded contacts and overrides all changes in %USERPROFILE%\My Documents\Telerik\Icenium\Simulator\Contacts\contacts.json.

If you are running the command-line interface on a macOS system, perform the following steps.

On macOS systems, AppBuilder stores an editable copy of the mock contacts database in ~/.local/share/Telerik/BlackDragon/contacts.json. When you reload the default contacts, this file is overridden with the default contacts and all changes are lost.

  1. In the title bar of the simulator, select ToolsLaunch Instruments.
  2. Click Contacts.
    By default, the device simulator does not load any contacts.
  3. To load the default mock contacts database, click Load default and confirm the operation.
    The device simulator does not show a list of the loaded contacts.
  4. (Optional) Click Remove all to delete all loaded contacts.
  5. (Optional) Load a custom mock database.
    1. Verify that you have created a custom mock database as a JSON file.
      The syntax of the JSON file must resemble the syntax of the default contacts database stored in ~/.local/share/Telerik/BlackDragon/contacts.json.
    2. Click Import, navigate to the location where the custom database is stored and click Select file.
      The device simulator adds the imported contacts to the current database and does not replace it. The device simulator does not show a list of the loaded contacts.
  6. (Optional) To store a copy of the current contacts database, click Export and save it as a JSON file on your local file system.

Next Steps

Simulate changes in file storage.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.