// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!

    \previouspage design-viewer-single-page-navigation.html
    \page qt-ui-viewer.html
    \nextpage studio-exporting-and-importing.html

    \title Viewing Applications on Android

    View \QDS projects that you have shared online in \QUV.
    Bring all the projects from a \QDS ID to \QUV, or establish a direct
    network connection for a real-time preview of your current \QDS project.
    These projects then run on your Android device. You can also
    adjust settings, view logs, and run example projects.

    \note This feature is included in the
          \l{https://www.qt.io/pricing}{Qt Design Studio Enterprise license}.
          \uicontrol {Share Application Online} and \uicontrol {Deploy Project to Android}
          are unavailable in \QDS without the Enterprise license.

    \section1 Installing Qt UI Viewer

    \image qtuiviewer-appstore.webp

    To install \QUV on your Android device:
    \list 1
      \li Open the Google Play store on your Android device.
      \li Search for \QUV.
      \li Select \uicontrol Install.
      \li Open \QUV.
    \endlist

    \section1 Connecting a \QDS ID with \QUV

    Connect your \QDS ID to \QUV to access all your shared \QDS projects in \QUV.

    To do that:
    \list 1
      \li Open \QDS on your computer.
      \li Open or create a project in \QDS.
      \li Go to \uicontrol File > \uicontrol {Share Application Online}.

          \inlineimage menu-share-application-online.webp
          \inlineimage studio-share-application-online.webp

      \li Open \QUV on your Android device.
      \li Select \uicontrol {Scan QR Code}.
          \image qtuiviewer-scan-qr-code.webp
      \li Scan the QR code from Share Application Online in the \QDS.
    \endlist

    \note Only one \QDS ID can be connected to the \QUV at a time.

    \section1 Running a \QDS Project in \QUV

     Once the projects are in \QUV:
      \list 1
            \li Select a project from the drop-down.
            \li Select \uicontrol {Run Project}.
              \image qtuiviewer-live-project.webp
      \endlist

      Control how frequently \QUV updates the projects or make the project
      fit the device display from \QUV \uicontrol {Settings}.

      To specify these settings:
      \list 1
        \li Go to \uicontrol File > \uicontrol {Settings}.
        \li Toggle the \uicontrol {Update user projects in the background} or
            the \uicontrol {Auto scale the project} setting.
        \image qtuiviewer-settings.webp

        \note The setting "Auto scale the project" works independent of the \QDS
              ID connection.
      \endlist

    \section1 Creating a Network Connection between \QDS and \QUV

      To create a direct connection with a \QDS project without using a
      \QDS ID, first, get your Android device's \e {Local IP} from \QUV.
      Then, use the \e {Local IP} in \QDS.

      To get the \e {Local IP} from \QUV:
      \list 1
        \li Go to \uicontrol Menu > \uicontrol Network.
        \li Note the \e {Local IP} of your Android device.
          \image qtuiviewer-network.webp
      \endlist

      To establish a direct connection between \QUV and \QDS:
      \list 1
        \li Open \QDS on your computer.
        \li Open the project you want to connect directly.
        \li Go to \uicontrol File > \uicontrol {Deploy Project to Android}.
        \li Enter the \e {Local IP} you got from \QUV into \uicontrol {Device IP}.
        \li Select \uicontrol Connect.
          \image studio-deploy-project-to-android.webp

        \li Select \uicontrol {Send Project}.
        \li In \QUV, select \uicontrol Menu > \uicontrol Network. The \QDS project
            now runs in \QUV.
      \endlist

      \note The Android device needs to be on the same network as the \QDS
      workstation for the connection to work. Also, automatic synchronization
      is not possible. To update your project manually send it again.

*/
