Examples

Kanzi Connect comes with example applications that you can use as a basis for prototyping. You can find example applications in the <KanziConnectInstallation>/SDK/examples directory.

To create Kanzi Connect applications for platforms other than Windows and Android, you must download and install the Kanzi Connect platform packages separately. If you do not have Kanzi Connect installed and use the content from the Kanzi Connect Content Pack, you must download and extract the content pack too.

Running example projects

All example projects use connected services to exchange data and perform actions. The prerequisite for the operation is a Kanzi Connect Server running locally (IP: 127.0.0.1).

To start a preconfigured Kanzi Connect Server, see Running a preconfigured Kanzi Connect Server.

Running an example project in Kanzi Studio

To run an example project in Kanzi Studio:

  1. In Kanzi Studio open the <KanziConnectInstallation>/SDK/examples/<ProjectName>/Tool_project/<ProjectName>.kzproj project.

  2. In the Kanzi Studio main menu select Kanzi Connect > Start Kanzi Connect Server.

    Kanzi Studio starts the Kanzi Connect Server that is installed on your computer.

    ../_images/start-kanzi-connect-server.png

Running an example project as a standalone executable on Windows

To run an example project as a standalone executable on Windows:

  1. In Kanzi Studio open the <KanziConnectInstallation>/SDK/examples/<ProjectName>/Tool_project/<ProjectName>.kzproj project.

  2. In the Kanzi Studio main menu select Kanzi Connect > Start Kanzi Connect Server.

    Kanzi Studio starts the Kanzi Connect Server that is installed on your computer.

    ../_images/start-kanzi-connect-server.png
  3. Select File > Export > Export as KZB Player for Windows.

  4. From <KanziConnectInstallation>/SDK/examples/<ProjectName>/Application/bin copy all dll dynamic librayr files and XML configuration files to the <KanziConnectInstallation>/SDK/examples/<ProjectName>/Tool_project/Application Player directory.

  5. In the <KanziConnectInstallation>/SDK/examples/<ProjectName>/Tool_project/Application Player directory run the application executable.

Running an example application on an Android device

To run an example project on an Android device:

  1. In Kanzi Studio open the <KanziConnectInstallation>/SDK/examples/<ProjectName>/Tool_project/<ProjectName>.kzproj project.

  2. In the Kanzi Studio main menu select Kanzi Connect > Start Kanzi Connect Server.

    Kanzi Studio starts the Kanzi Connect Server that is installed on your computer.

    ../_images/start-kanzi-connect-server.png
  3. To run the application on an Android device:

    1. In Kanzi Studio in the Kanzi Connect Editor window set:

      • Server IP Address to the IP address of the computer where you started the Kanzi Connect Server

      • Server Port to the port of the computer where you started the Kanzi Connect Server

      The Server IP Address and Server Port properties set the address and port of the Kanzi Connect Server that the client application uses during runtime.

      ../_images/host-ip-address-host-port.png
    2. Connect your Android device to your computer and set the connection type to Transfer Files.

      This way you can access the device file system with Windows Explorer.

    3. In Kanzi Studio main menu select File > Export > Build Android Package.

      Kanzi Studio creates an Android package from your Kanzi Studio project, deploys, and runs it on your Android device.

      When the application starts, it connects to the Kanzi Connect Server that runs on the IP address and port you set in the Kanzi Connect window in Kanzi Studio.

      ../_images/build-android-package.png