summaryrefslogtreecommitdiffstats
path: root/README
blob: a98d7e2b8f9123e99aa05285d66c55f96ca2a429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# QML for Android

QML wrappers for native Android controls.

## Introduction

This is a former Qt hackathon project born in November 2014.
Credits for the original idea and the groundwork go to Attila Csipa:
- http://achipa.blogspot.no/2014/11/qml-wrappers-for-native-android.html
- http://achipa.blogspot.no/2014/11/native-ui-in-qt-on-android-without.html

## Requirements

- Qt 5.4 or later
- Android 5.x
- Gradle

## Installation

Build and install like any Qt module.

## Getting Started

Link to the library, and deploy the desired Android packages
in the application .pro file:

    QT += qmlandroid
    QMLANDROID_PACKAGES = app view widget

A minimal QML example that can replace the main.qml when using
the Qt Quick Application template in Qt Creator. The rest can
stay the same, using QQmlApplicationEngine to load the main.qml:

    import android 0.21
    import android.app 0.21
    import android.view 0.21
    import android.widget 0.21

    Activity {
        contentView: Button {
            text: "Button"
        }
    }

Using an options menu in Activity requires changing the activity
type in AndroidManifest.xml. The default activity type for Qt apps
is "org.qtproject.qt5.android.bindings.QtActivity", which must be
changed to "qt.android.app.QmlActivity". In order to create the
file, click "Create Templates" in Qt Creator:

    Projects -> Build & Run -> Build Steps -> Build Android APK

## Notes

The Android 5.x dependency is not going to stay. Proper Android version
handling is just missing for the time being. The goal of the hackathon
project was to create a visually stunning demo, not a polished product. ;)