Controlando el reproductor de música de Android con mi propia aplicación

I want to write some application to control android music player :) For example when i shake phone -> player should change music next one. Is it possible without rooting my phone?

preguntado el 25 de agosto de 12 a las 11:08

2 Respuestas

I think it is possible, here is a snippet for a performing playback through Intent.

Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER);


Intent intent = new Intent();  
File file = new File(YOUR_SONG_URI);  
intent.setDataAndType(Uri.fromFile(file), "audio/*");  

Fuente: Android iniciando el reproductor de música usando intent

You have to check if there are more Intents you can use by googleing (loading a playlist, etc.).

contestado el 23 de mayo de 17 a las 12:05

Note, this is far from "controlling music application" in terms of OP's question - Marcin Orlowski

the OP has an idea and seeks for solutions. I am entirely not sure if "control" is meant literally. - schrass

See this portion of his question "player should change music next one", which I assume referes to playlist entry. - Marcin Orlowski

To control any 3rd party application it first have to be willing to let you to. It is usually done by exposing public API of any sort, so other app would know how to do that. If music player of your choice offers that, then "yes" is the answer. If it does not, then usually it means "no", and rooting is not necessarily a magical solution either. If there's no API or any other communication channel exposed (even non publicly) then achieving your goal would be tricky.

Respondido 25 ago 12, 12:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.