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. QuickAndroid - QML Component Library for Android
Forum Updated to NodeBB v4.3 + New Features

QuickAndroid - QML Component Library for Android

Scheduled Pinned Locked Moved Mobile and Embedded
15 Posts 3 Posters 8.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.
  • benlauB Offline
    benlauB Offline
    benlau
    Qt Champions 2016
    wrote on last edited by
    #6

    v0.1.4 has been released.

    New Components

    TextField

    Features

    1. Material Design look and feel
    2. Long press will show PASTE button
    3. Text handle to move cursor and selection
    4. Floating Label

    Screenshot

    RaisedButton

    System

    1. Rename package of QuickAndroid.priv to QuickAndroid.Private
    2. QASystemDispatcher::dispatched() - Changed the name of first argument from “name” to “type. Following the naming convention of Flux application framework

    ActionBar

    1. Changed the default height from 48p to 56dp

    TabView

    1. Emit appear() and disappear() signal for index changes.

    FloatingActionButton

    1. Use Theme.colorAccent as default color

    TextStyle

    1. Added “disabledTextColor” property
    2. Added “bold” property
    1 Reply Last reply
    0
    • benlauB Offline
      benlauB Offline
      benlau
      Qt Champions 2016
      wrote on last edited by
      #7

      v0.1.5 has been released:

      New Components

      1. ImagePicker - Native Image Picker. Pick images from gallery or take photo by using native API.
      2. Page/PageStack - A replacement solution for original Application/Activity pair.
      3. BottomSheet

      Updates on Style Engine

      1. All the old Style classes are renamed to MaterialStyle. And inherit from components in QtQuick.Controls.Styles

      2. Added new kind of class - “Material”. They are used to provide style parameter to MaterialStyle components.

      3. ThemeManager - All the member’s data type has been changed from Style to Material.

      Updates on component

      Button

      1. Added “pressAndHold” property
      2. Change text and icon color in disabled mode

      RaisedButton

      1. Change text and icon color in disabled mode

      Dialog.qml

      1. Changed to Material Style
      2. Changed default width

      FloatingActionButton

      1. Added FloatingActionButtonMaterialStyle and FloatingActionButtonMaterial component

      Text
      1, Show text with different color on disabled mode.

      TextField

      1. Add placeholderTextColor property
      2. Add floatingLabelAlwaysOnTop property

      Theme

      1. Added “colorAccent” property

      Updates on system

      1. Registered an image provider for default images: “quickandroid-drawable"

      2. SystemDispatcher

      3. Able to work in non-Android environment.

      4. Support List type conversion

      5. Added “loadClass” method to load Java class.

      Bug Fixes

      1. Fixed a crash issue with JNI on Android 6.x

      2. QADrawableProvider - applied wrong tintColor for images in drawable folder.

      1 Reply Last reply
      0
      • benlauB Offline
        benlauB Offline
        benlau
        Qt Champions 2016
        wrote on last edited by
        #8

        v0.1.6 of QuickAndroid has been released!

        Release v0.1.6 release · benlau/quickandroid

        Features Highlight

        1. Support Ink effect on press
        2. Class Reference is now available online (Incomplete)
        3. Example program: Add splash screen (no black screen , no screen flicker)
        4. Asynchronous page creation during push

        New Component

        1. Ink - A MouseArea with ink/ripple effect on press

        Bug Fix

        1. Fixed issue #14 - PageStack lost focus after opened dialog

        Changes

        ActionBar

        1. Changed the type of “background” property from “var” to “Component"
        2. Added “backgroundColor” property

        Button

        1. Support ink effect
        2. Changed the type of “background” property from “var” to “Component"

        FloatingActionButton

        1. Support ink effect
        2. Renamed property “color” to “backgroundColor"

        RaisedButton

        1. Support ink effect

        Page Stack

        1. Supported to create component in asynchronous mode
        2. Added “asynchronous” property to enable/disable asynchronous component creation
        3. Added “queueEnabled” property to enable/disable queued push/pop

        TabBar

        1. Support Ink effect

        ListItem

        1. Support ink effect

        Device

        1. Added “os” property
        2. Added “isTablet” property (Experimental code)

        Class Reference:
        QuickAndroid Project Class Reference

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

          Hello, I download your Library, and try to use this, but i can't run Example on Android device. Project builded, and when I try to run this, it floating in loader page with image of Qt. But if I try to run it on my computer, it's work.
          I download apk from your blog, and it's work.
          I try to use this Library in my project and some components work, but ImagePicker don't work. It's open library of photos on my mobile, but when i picked photos, it's don't download this photos in page.
          May be you can help me with it.
          Sorry for my English, and thank you in advance:)

          benlauB 1 Reply Last reply
          0
          • S sanekyy

            Hello, I download your Library, and try to use this, but i can't run Example on Android device. Project builded, and when I try to run this, it floating in loader page with image of Qt. But if I try to run it on my computer, it's work.
            I download apk from your blog, and it's work.
            I try to use this Library in my project and some components work, but ImagePicker don't work. It's open library of photos on my mobile, but when i picked photos, it's don't download this photos in page.
            May be you can help me with it.
            Sorry for my English, and thank you in advance:)

            benlauB Offline
            benlauB Offline
            benlau
            Qt Champions 2016
            wrote on last edited by
            #10

            @sanekyy

            For the problem of example program, could you post the error log?

            For the problem of ImagePicker, are you using custom Activity class? If not, you may change it to "quickandroid.QuickAndroidActivity"

            Example:

            quickandroid/AndroidManifest.xml at master · benlau/quickandroid

            Since ImagePicker calls other Activity to pick image, it need to register a callback in Java code. "quickandroid.QuickAndroidActivity" will handle it for you.

            It is not documented yet. I will write about it later.

            S 1 Reply Last reply
            0
            • benlauB benlau

              @sanekyy

              For the problem of example program, could you post the error log?

              For the problem of ImagePicker, are you using custom Activity class? If not, you may change it to "quickandroid.QuickAndroidActivity"

              Example:

              quickandroid/AndroidManifest.xml at master · benlau/quickandroid

              Since ImagePicker calls other Activity to pick image, it need to register a callback in Java code. "quickandroid.QuickAndroidActivity" will handle it for you.

              It is not documented yet. I will write about it later.

              S Offline
              S Offline
              sanekyy
              wrote on last edited by
              #11

              @benlau
              Here is error log

              About ImagePicker, I change Activity class as in your example in Manifest and it's working, thx

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sanekyy
                wrote on last edited by
                #12

                Hello, if I have idea that you can add to the library, where i can offer it to you?

                benlauB 1 Reply Last reply
                0
                • S sanekyy

                  Hello, if I have idea that you can add to the library, where i can offer it to you?

                  benlauB Offline
                  benlauB Offline
                  benlau
                  Qt Champions 2016
                  wrote on last edited by
                  #13

                  @sanekyy said:

                  Hello, if I have idea that you can add to the library, where i can offer it to you?

                  You may submit a feature request at:

                  https://github.com/benlau/quickandroid/issues

                  1 Reply Last reply
                  0
                  • benlauB Offline
                    benlauB Offline
                    benlau
                    Qt Champions 2016
                    wrote on last edited by
                    #14

                    v0.1.7 has been released.

                    New Features

                    1. Support high DPI mode. A.dp will be adjusted to a correct value

                    Bug Fixes

                    1. Crash with Visual Studio

                    New Singleton Components

                    1. Units - Units conversion class. Provide Units.dp() as replacement of A.dp

                    Changes

                    SystemDispatcher

                    1. Support nested map type

                    ink

                    1. Add minRadius property

                    Example code

                    1. Able to build with gradle
                    1 Reply Last reply
                    0
                    • benlauB Offline
                      benlauB Offline
                      benlau
                      Qt Champions 2016
                      wrote on last edited by benlau
                      #15

                      Hello, I have forked a new library called AndroidNative.pri from the QuickAndroid project. It is a helper library to access the Java library you wrote without using JNI. And it has bundled few components and Android API wrapper too.

                      http://www.github.com/benlau/androidnative.pri

                      Calling Android functions from Qt without using JNI

                      It is forked from the QuickAndroid project that aim to provide a library to access Android functions from Qt/QML without using JNI.

                      Remarks: This project only support gradle build system.

                      Features

                      1. SystemDispatcher - A message queue for C++/Qt and Java/Android
                      2. Send message in C++, receive in Java and vice versa.
                      3. Data type will be converted automatically (e.g QMap <-> java.util.Map). No need to write in JNI.
                      4. It could be used to write your own Java code
                      5. Bundled Components
                      6. Image Picker
                      7. Toast
                      8. Wrapper of android.os.Environment / android.os.Debug / MediaScannerConnection

                      C++ API

                      1. Environment::getExternalStoragePublicDirectory()
                      2. MediaScannerConnection::scanFile()
                      3. Debug::getNativeHeapSize()
                      4. Debug::getNativeHeapAllocatedSize()

                      The functions above do not require to config gradle before using.

                      QML Components

                          import AndroidNative 1.0
                      
                      1. ImagePicker
                      2. Toast

                      SystemDispatcher

                      SystemDispatcher is a message queue component for delivering action message between C++/QML and Java. Data type in message is converted to the target platform automatically (e.g QMap <-> java.util.Map) . So that user doesn't need to write JNI to access their Java functions.

                      Moreover, SystemDispatcher is compilable on a non-Android platform. It doesn't cause any trouble to run on your development host.

                      // C++ Example
                      
                      #include <AndroidNative>
                      
                      // Load a Java class. It will trigger the code within `static` block
                      SystemDispatcher::instance()->loadClass("androidnative.example.ExampleService");
                      
                      QVariantMap message;
                      message["value1"] = 1;
                      message["value2"] = 2.0;
                      message["value3"] = "3";
                      
                      // Dispatch a message
                      SystemDispatcher::instance()->dispatch("androidnative.example.dummyAction", message);
                      
                      
                      // QML Example
                      
                      import AndroidNative 1.0
                      
                      Item {
                      
                        Component.onCompleted: {
                          var message = {
                            value1: 1,
                            value2: 2.0,
                            value3: "3"
                          }
                          SystemDispatcher.dispatch("androidnative.example.dummyAction", message);
                        }
                      }
                      
                      // Java Receiver
                      
                      public class ExampleService {
                      
                          static {
                      
                              SystemDispatcher.addListener(new SystemDispatcher.Listener() {
                      
                                  public void onDispatched(String type , Map message) {
                      
                                      if (type.equals("androidnative.example.dummyAction")) {
                                          // Process then dispatch a response back to C++/QML                    
                                          SystemDispatcher.dispatch(("androidnative.example.response");
                                      
                                          return;
                                      }
                                      return;
                                  }        
                              });        
                           }
                      }
                      
                      
                      // Listen from QML
                      
                      Connections {
                        target: SystemDispatcher
                        onDispatched: {
                          // process the message
                        }
                      }
                      

                      Supported data type:

                      Qt Java
                      int int
                      bool boolean
                      QString String
                      QVariantList List<T>
                      QVariantMap Map<T>

                      Installation Instruction

                      androidnative.pri/installation.md at master · benlau/androidnative.pri

                      Example

                      An example program is available at: androidnative.pri/examples/androidnativeexample at master · benlau/androidnative.pri

                      example1.png (533×472)

                      1 Reply Last reply
                      2

                      • Login

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