Code Monkey home page Code Monkey logo

skiptracklongpressvolume's Introduction

Long press volume to skip tracks

Please note that due to restrictions imposed by the Android system, detecting long volume button presses while the screen is off is no longer possible. However, it does still work if you are using Androids Always-On Display :-)

This repo provides a systemless and standalone application which let's you skip tracks on your Android Oreo (8.0+) device by long pressing the volume keys while the screen is off. It doesn't require root but a permission has to be granted to the app via adb. For more information see the details below.

Installation

Download the newst version of the apk here and install it as usual on your device. After that connect your device to a computer, enable developer settings and fire up following command:

adb shell pm grant com.cilenco.skiptrack android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER

On startup the app will check if has the permission. If you don't see any message the process worked and you are ready to go. If the app is installed as system application by flashing it through a recovery this step is not needed as the permission is granted automatically.

For developers

Please feel free to send me pull requests for improvements, stability and new feature ideas. Because the application uses the hidden API you have to use a modified version of the android.jar file for compiling. For this download the required android.jar file from the linked repo and replace it with original one in <SDK location>/platforms/android-<API version>/.

If you change the targetSdk or minimumSdk make sure to use the proper file.

Testing

You can test this app on an emulator by just giving it the permission as described above. After that you can send long press events of the volume keys to the emulator with following lines:

adb shell input keyevent --longpress KEYCODE_VOLUME_UP
adb shell input keyevent --longpress KEYCODE_VOLUME_DOWN

If anyone has a better solution for this (i.e. detect a new MediaSession and start the service in response) please open an issue for this or send me a pull request. Remember that this should act as a system feature so a notification (e.g. in ForegroundServices) should be avoided.

skiptracklongpressvolume's People

Contributors

cilenco avatar jonas-haeusler avatar mumumusuc avatar sorgelig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.