Java tutorial
//package com.java2s; import android.app.Instrumentation; import android.view.KeyEvent; public class Main { public static void volumeAdd() { new Thread(new Runnable() { @Override public void run() { Instrumentation m_Instrumentation = new Instrumentation(); m_Instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_VOLUME_UP); } }).start(); } }