// VolumeControl.javapackage org.myfirm.myappimport org.myfirm.myapp.QtApplicationimport org.myfirm.myapp.QtActivityimport android.media.AudioManagerpublic class VolumeControl extends QtActivity{ public void Mute(){ } public void VolumeUp(){ } public void VolumeDn(){ }}
Javapackage org.myfirm.myapp;
Javapackage org.myfirm.myapp; import org.qtproject.qt5.android.bindings.QtActivity;import android.media.AudioManager;
public class NotificationClient extends org.qtproject.qt5.android.bindings.QtActivity
void volCtrl::volumeUp(){#ifdef __ANDROID__ QAndroidJniObject::callStaticMethod<void>( "org/myfirm/myapp/PlayControl", "volumeUp" ); qDebug()<<"volup";#endif}void volCtrl::volumeDn(){#ifdef __ANDROID__ QAndroidJniObject::callStaticMethod<void>( "org/myfirm/myapp/PlayControl", "volumeDn" ); qDebug()<<"voldn";#endif}
package org.myfirm.myapp;import org.myfirm.myapp.QtActivity;import android.media.AudioManager;public class PlayControl extends QtActivity{ public static void VolumeUp(){ AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.adjustVolume(ADJUST_RAISE, FLAG_SHOW_UI); } public static void VolumeDn(){ AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.adjustVolume(ADJUST_LOWER, FLAG_SHOW_UI); }}
QAndroidJniObject r = QAndroidJniObject::callStaticObjectMethod<jstring>( "org/myfirm/myapp/PlayControl", "volumeDn");if( !r.isValid() ) qCritical()<<"Object not valid";
public class PlayControl extends org.qtproject.qt5.android.bindings.QtActivity{ public PlayControl(){} public void _VolumeUp(){ AudioManager am = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE); am.adjustVolume(AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); } public static void VolumeUp(){ new PlayControl()._VolumeUp(); }}
void PlCtrlwidget::volumeUp(){#ifdef __ANDROID__ QAndroidJniObject::callStaticMethod<void>( "org/myfirm/myapp/PlayControl", "volumeUp");#endif}
public static void VolumeUp(){ return 101; }
void PlCtrlwidget::volumeUp(){#ifdef __ANDROID__ qDebug()<<QAndroidJniObject::callStaticMethod<jint>( "org/myfirm/myapp/PlayControl", "volumeUp");#endif}
public static int VolumeUp(){ new PlayControl()._VolumeUp(); return 101; }
public static int PlayPauseDn(){ PlayControl p = new PlayControl(); p._PlayPauseDn(); return 202; }
public int _VolumeUp(){ return 111; }
void PlCtrlwidget::VolumeUp(){#ifdef __ANDROID__ QAndroidJniObject o("org/myfirm/myapp/PlayControl"); qDebug()<<o.callMethod<jint>( "_VolumeUp" );#endif}
public int _VolumeUp(){ return 101; }
void PlCtrlwidget::volumeUp(){#ifdef __ANDROID__ QAndroidJniObject a = QtAndroid::androidActivity(); qDebug()<<a.isValid()<<a.callMethod<jint>( "_volumeUp");#endif}
package org.myfirm.myapp;import org.qtproject.qt5.android.bindings.QtApplication;import org.qtproject.qt5.android.QtNative;import android.media.AudioManager;import android.content.Context;public class PlayControl extends org.qtproject.qt5.android.bindings.QtActivity{ private static AudioManager a() { return (AudioManager) QtNative.activity().getApplicationContext().getSystemService(Context.AUDIO_SERVICE); } public static void VolumeUp(){ a().adjustVolume(AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); } public static void VolumeDn(){ a().adjustVolume(AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); }}