Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Use VirtualKeyboard in Android
Forum Updated to NodeBB v4.3 + New Features

Use VirtualKeyboard in Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
12 Posts 5 Posters 5.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sassanh
    wrote on last edited by
    #1

    Is it possible to use qtvirtualkeyboard in Android?

    I cloned the qt/virtualkeyboard repo
    checked out 5.10.1
    compiled release build (edited)
    ran make install in the build directory
    I checked the files Qt/5.10.1/android_armv7/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so and Qt/5.10.1/android_armv7/qml/QtQuick/VirtualKeyboard/Styles/libqtvirtualkeyboardstylesplugin.so are created
    then built my project and deployed it
    when I run it I still get: module "QtQuick.VirtualKeyboard" is not installed
    I extracted the apk file and the .so plugins where present there in libs directory and assets/--Added-by-androiddeployqt--/qml/QtQuick/VirtualKeyboard/qmldir, etc were there.
    the error message is not informative and I can't see any other error messages in logcat

    Any suggestion?

    J.HilkJ jsulmJ 2 Replies Last reply
    0
    • S sassanh

      Is it possible to use qtvirtualkeyboard in Android?

      I cloned the qt/virtualkeyboard repo
      checked out 5.10.1
      compiled release build (edited)
      ran make install in the build directory
      I checked the files Qt/5.10.1/android_armv7/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so and Qt/5.10.1/android_armv7/qml/QtQuick/VirtualKeyboard/Styles/libqtvirtualkeyboardstylesplugin.so are created
      then built my project and deployed it
      when I run it I still get: module "QtQuick.VirtualKeyboard" is not installed
      I extracted the apk file and the .so plugins where present there in libs directory and assets/--Added-by-androiddeployqt--/qml/QtQuick/VirtualKeyboard/qmldir, etc were there.
      the error message is not informative and I can't see any other error messages in logcat

      Any suggestion?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @sassanh ,
      from my understanindg VirtualKeyboard is not available for Android and iOS

      https://doc.qt.io/qt-5.10/qtmodules.html

      0_1523874906770_0e9f3cbb-990c-4ea9-b12f-64ce4cb1849c-image.png


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • S sassanh

        Is it possible to use qtvirtualkeyboard in Android?

        I cloned the qt/virtualkeyboard repo
        checked out 5.10.1
        compiled release build (edited)
        ran make install in the build directory
        I checked the files Qt/5.10.1/android_armv7/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so and Qt/5.10.1/android_armv7/qml/QtQuick/VirtualKeyboard/Styles/libqtvirtualkeyboardstylesplugin.so are created
        then built my project and deployed it
        when I run it I still get: module "QtQuick.VirtualKeyboard" is not installed
        I extracted the apk file and the .so plugins where present there in libs directory and assets/--Added-by-androiddeployqt--/qml/QtQuick/VirtualKeyboard/qmldir, etc were there.
        the error message is not informative and I can't see any other error messages in logcat

        Any suggestion?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @sassanh Why do you need it on Android?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sassanh
          wrote on last edited by
          #4

          I'm building a station app and it'd be nice if I could have the custom keyboard for it (I built a custom layout which works on my desktop.)
          I wonder why would it not work on Android?

          jsulmJ 1 Reply Last reply
          0
          • S sassanh

            I'm building a station app and it'd be nice if I could have the custom keyboard for it (I built a custom layout which works on my desktop.)
            I wonder why would it not work on Android?

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @sassanh said in Use VirtualKeyboard in Android:

            I wonder why would it not work on Android?

            Probably because Android already has one

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            J.HilkJ 1 Reply Last reply
            0
            • jsulmJ jsulm

              @sassanh said in Use VirtualKeyboard in Android:

              I wonder why would it not work on Android?

              Probably because Android already has one

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by J.Hilk
              #6

              @jsulm
              to be honest I would love for the keyboard to work also on android&iOS,

              because I have a number of textinputs that expect a formated number somewhere between -99.9 and 99.9

              but Qt::ImhFormattedNumbersOnly has, atm., the same functionality as ImhDigitsOnly, meaning no decimal point no minus sign no done button etc.

              Therefore I'm forced to use Qt::ImhPreferNumbers that brings up the whole keyboard, but with the numbers in the top most row.

              Would I be able to use the Virtualkeyboard one could circumvent the whole problem. And it would give it a more unified look across OS'es


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              1
              • S Offline
                S Offline
                sassanh
                wrote on last edited by
                #7

                @jsulm

                1. The one that android "already" has is not customizable.
                2. Qt has the code to provide a virtual keyboard that's fully customizable which works for Desktop and Embedded devices.
                3. Open qt.io, I see this tag in head element of the page:
                  <title>Qt | Cross-platform software development for embedded & desktop</title>
                  which implies that Qt's main feature and main promise is being "Cross-platform"

                So I guess instead of asking "why some code written with Qt should work in some platform?" we should ask "why a particular code written in Qt and present in official Qt releases doesn't work for a particular platform?". If it's working for embedded devices then it looks like someone blocked it to work for Android devices and I wonder why.

                Other than the ability to customize the keyboard, when I compile my apk as a Launcher application in immersive mode and deploy it to my tablet after using my installed keyboards on the device, navigation keys bring back to the screen and don't hide anymore which ruins the whole immersive mode experience. qtvirtualkeyboard could help me with that too.

                sierdzioS 1 Reply Last reply
                0
                • S sassanh

                  @jsulm

                  1. The one that android "already" has is not customizable.
                  2. Qt has the code to provide a virtual keyboard that's fully customizable which works for Desktop and Embedded devices.
                  3. Open qt.io, I see this tag in head element of the page:
                    <title>Qt | Cross-platform software development for embedded & desktop</title>
                    which implies that Qt's main feature and main promise is being "Cross-platform"

                  So I guess instead of asking "why some code written with Qt should work in some platform?" we should ask "why a particular code written in Qt and present in official Qt releases doesn't work for a particular platform?". If it's working for embedded devices then it looks like someone blocked it to work for Android devices and I wonder why.

                  Other than the ability to customize the keyboard, when I compile my apk as a Launcher application in immersive mode and deploy it to my tablet after using my installed keyboards on the device, navigation keys bring back to the screen and don't hide anymore which ruins the whole immersive mode experience. qtvirtualkeyboard could help me with that too.

                  sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  @sassanh said in Use VirtualKeyboard in Android:

                  If it's working for embedded devices then it looks like someone blocked it to work for Android devices and I wonder why

                  I suppose it's because it would take time and effort to support it on 2 additional platforms. Keyboards are highly platform-specific stuff. And in this case, most people don't need a custom Qt keyboard on Android, so the cost vs. benefit is won by "cost".

                  We're investigating porting Qt keyboard to Android in my company currently, if we succeed, perhaps we'll push the changes upstream (not sure if that will be possible at this point, but hopefully yes).

                  (Z(:^

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    sassanh
                    wrote on last edited by
                    #9

                    @sierdzio , if your company is investigating on it then probably you have evidence that there are obstacles for having qtvirtualkeyboard on Android. I hope you decide to push the changed upstream and it's possible for you to do it. I also hope these changes find their way to next releases of Qt itself.
                    Thanks for info.

                    sierdzioS 1 Reply Last reply
                    0
                    • S sassanh

                      @sierdzio , if your company is investigating on it then probably you have evidence that there are obstacles for having qtvirtualkeyboard on Android. I hope you decide to push the changed upstream and it's possible for you to do it. I also hope these changes find their way to next releases of Qt itself.
                      Thanks for info.

                      sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      @sassanh said in Use VirtualKeyboard in Android:

                      @sierdzio , if your company is investigating on it then probably you have evidence that there are obstacles for having qtvirtualkeyboard on Android

                      I don't, at least not yet. We've just started like literally last week :D

                      I anticipate huge amount of issues with input events - most probably we'd have to block all input events and handle them internally (because otherwise, Android's keyboard would show up), but that will in turn cause massive amount of issues (sleep timer not resetting, copy paste not working etc.). At this point, though, I'm only guessing.

                      (Z(:^

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sassanh
                        wrote on last edited by
                        #11

                        @sierdzio Fortunately my problem with the launcher app is solved. I wish things go well on your side and you don't face huge obstacles. I appreciate you sharing this info here and your will to push your android keyboard upstream.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          MArian
                          wrote on last edited by
                          #12

                          Hi, I can confirm that with some changes in Qt sources it is possible to run Qt Virtual Keyboard on iOS and Android. If someone is still interested, take a look on this information from KDAB:
                          https://www.kdab.com/wp-content/uploads/stories/VirtualKeyboards.pdf

                          especially page 13 of the document. To make Virtual Keyboard component work on Android, Qt library should be modified in qandroidplatformintegration class and in qiosintegration class for iOS.

                          For example here is the code that may be added to qandroidplatformintegration class constructor:

                          QString icStr = QPlatformInputContextFactory::requested();
                          m_platformInputContext.reset(icStr.isNull() ? new QAndroidInputContext() : QPlatformInputContextFactory::create(icStr));
                          

                          If "QT_IM_MODULE" environmental variable will be set then icStr will be not null and QPlatformInputContextFactory::create(icStr) will create appropriate virtual keyboard plugin.

                          What is also important on iOS devices virtual keyboard needs to be linked statically:
                          https://doc.qt.io/archives/qt-5.10/qtvirtualkeyboard-build.html#static-builds

                          Cheers!

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved