[solved] Android volume control
-
-
Hi,
AFAIK, there's no inbuilt way in Qt. You will have to rely on the Android API's. For it you will need to call Android API's from Qt.
Have a look at "qtandroidextras":http://qt-project.org/doc/qt-5/qtandroidextras-module.html and "qandroidjniobject":http://qt-project.org/doc/qt-5/qandroidjniobject.html. Also an example "here":http://qt-project.org/doc/qt-5/qtandroidextras-notification-example.html -
[quote author="p3c0" date="1404474027"]Hi, AFAIK, there's no inbuilt way in Qt. You will have to rely on the Android API's. For it you will need to call Android API's from Qt. Have a look at "qtandroidextras":http://qt-project.org/doc/qt-5/qtandroidextras-module.html and "qandroidjniobject":http://qt-project.org/doc/qt-5/qandroidjniobject.html. Also an example "here":http://qt-project.org/doc/qt-5/qtandroidextras-notification-example.html[/quote]
Thx!
I will have a closer look into it.
I wonder is there a function in android ndk I could wrap as a qml component and use it in qml to adjust system volume.
-
I don't think so android would allow it directly unless the system is rooted and more if a such a C function exists.
-
You can easily use QtAndroidExtras to call from C++ your java method, and then you can wrap the QtAndroidExtras into a QObject and export it to QML side.
I did it for other stuffs and works great.[quote author="habamax" date="1404475287"][quote author="p3c0" date="1404474027"]Hi, AFAIK, there's no inbuilt way in Qt. You will have to rely on the Android API's. For it you will need to call Android API's from Qt. Have a look at "qtandroidextras":http://qt-project.org/doc/qt-5/qtandroidextras-module.html and "qandroidjniobject":http://qt-project.org/doc/qt-5/qandroidjniobject.html. Also an example "here":http://qt-project.org/doc/qt-5/qtandroidextras-notification-example.html[/quote]
Thx!
I will have a closer look into it.
I wonder is there a function in android ndk I could wrap as a qml component and use it in qml to adjust system volume.
[/quote]