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. Native WebView from Android on Qt

Native WebView from Android on Qt

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 4.9k Views 1 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
    Sanchir Kartiev
    wrote on last edited by
    #1

    Hello, everyone! I have a problem with using QWebView on Android (it's just not exist). How can I use Native Web View?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rom8726
      wrote on last edited by
      #2

      I use JNI for sending commands (create, attach to main layout, move, resize, load URL) from C code to Java code (QtActivity.java). May be, it's not better way, but another I not found.
      I.e. I created some class at C++ code, named QtAndroidWebView (inheritor QWidget), where I overrides needed functions to manipulate native Web View object through JNI.
      And I use this code to add WebView to main layout:
      @FrameLayout mainLayout = (FrameLayout) findViewById(R.id.content);
      mainLayout.addView(webView, params);@
      But here exists big problem: native webview displayed over all that drawing Qt. And if you open any dialog, then native webview overrides your dialog. For solving this problem I hide webview then it's dialog not activated (QEvent::ActivationChange event).
      In one word, it is very sorrowfully:)

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Sanchir Kartiev
        wrote on last edited by
        #3

        Thank you! I will try this variant.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rom8726
          wrote on last edited by
          #4

          Small example: https://code.google.com/p/qt-android-native-web-view-example/

          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