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
QtWS25 Last Chance

QuickAndroid - QML Component Library for Android

Scheduled Pinned Locked Moved Mobile and Embedded
15 Posts 3 Posters 8.2k Views
  • 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
    #3

    [quote author="Iktwo" date="1410886440"]Thanks for sharing, it looks very nice.

    I have only one comment for your ActionBar, you are setting the height to 48dp, which is actually the height for phones in portrait, landscape should be 40dp and it should be 56dp on tablets, I took my values from here:

    "Android Cheatsheet For Graphic Designers":http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/

    I also have my set of components, my project also focuses on Android right now, but the idea is to target iOS also.

    "Components":https://github.com/iktwo/components

    Maybe we can help each other :) [/quote]

    yes , it will be great!! Followed you on github already. wow , you did a lots of C++ component already.

    For the problem of Action Bar , I know that the height is different for phone and tablet , pc. But my library don't have the code to detect type of device and a provide menuBar that could scale the image automatically. Need to support those feature first. Thank for reminding~

    (p.s I suppose menu icon should be scaled to fit the action bar height instead of making new icon for tablet . Am I correct?)

    I have read from your code that you have provided the interface but seem that the detection is also not done yet?

    I will also work for iOS later but probably will be another library since they are quite different. Will only share some basic components like drawable , button etc.

    By the way , I have listed my wish list / todo items as a vision of the library at. Just wonder do we share similar vision:

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

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

      v0.1.2 has been released.

      Changes:

      New Components & Features

      1. Support tintColor in QADrawableProvider.
      2. ListItem
      3. FloatingActionButton

      System

      1. QADrawableProvider
      2. Supported to load image from drawable/ folder. Not only from drawable-*dpi
      3. May tint a drawable image by using tintColor argument to provider.

      Android Integration

      1. Added QuickAndroidActivity.java as an alternative Activity class for launching Qt application
      2. Once the onActivityResult() is invoked, it will forward the arguments to SystemDispatcher
      3. SystemDispatcher
      4. Add onActivityResult() helper function to forward the arguments passed to onActivityResult.

      ActionBar:

      1. Align icon and title according to keyline as described in Material design
      2. Renamed the "icon" property to "iconSource"

      Deprecated:

      1. DividerHorzonalHoloLight - Replaced by ListDivider
      1 Reply Last reply
      0
      • benlauB Offline
        benlauB Offline
        benlau
        Qt Champions 2016
        wrote on last edited by benlau
        #5

        v0.1.3 has been released.
        Changelog

        Critical Changes

        1. Min requirement of Qt version has been raised to Qt 5.4
        2. Dropped QuickAndroid.def package. All the constant value has been merged into Constants singleton component.
        3. Renamed the package of QuickAndroid.style to QuickAndroid.Styles
        4. Dropped Style singleton component. User should get current theme from ThemeManager.currentTheme from QuickAndroid.Styles package.
        5. All the Style components use DP unit for component size.

        The following components are dropped. They are not implemented by Material design :

        1. PopupMenu
        2. DropDownList
        3. Spinner

        New Components

        1. TabBar and TabView
        2. DropDownMenu
        3. Paper
        4. Text
        5. Button

        Style Components

        Added “extend” property for user to create derived style class form existing Theme object.

        Example:

        ActionBar {
            style: ActionBarStyle {
            extend: [ ThemeManager.currentTheme.actionBar, {
               “titleTextStyle.textColor” : Constants.white100
            }  ]
           }
        }
        

        or

        ActionBar {
           style: ActionBarStyle {
              Component.onComponent {
                 merge(this,ThemeManager.currentTheme.actionBar);
                    titleTextStyle.textColor = Constants.white100   
                 }
           }
        }
        

        Drawable Provider

        1. Bug Fix - Crash on handling mono image (1bit depth)
        2. Bug Fix - It don’t resize image according to sourceSize.

        Drawable

        1. Now it may take Component as input to source property

        e.g

        Drawable {
            source: Rectangle { color:”red” };
        }
        
        1. Bug Fix - Can not handle Color object as input to source property

        Action Bar

        1. ActionBarStyle - Added “unitHeight” property to control the heigh of control item.
        2. Reimplemented by Material Design
        3. Title is not part of action button
        4. Move title according to keyline
        5. Added iconSource, background properties

        A

        1. Changed the implementation from C++ to QML
        2. Added A.px() and A.drawable() functions

        FloatingActionButton

        1. Added “size” property to choose large/small size of button

        Activity

        1. “actionBar” property is not a component anymore. Now it take Item type.

        ListItem

        1. ListItemStyle - Added “showDivider” property

        Screenshot

        1 Reply Last reply
        0
        • 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