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?
Asked
Active
Viewed 1,805 times
2 Answers
0
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.

Marcin Orlowski
- 72,056
- 11
- 123
- 141
0
I think it is possible, here is a snippet for a performing playback through Intent
.
Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER);
startActivity(intent);
or
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File(YOUR_SONG_URI);
intent.setDataAndType(Uri.fromFile(file), "audio/*");
startActivity(intent);
Source: Android launching music player using intent
You have to check if there are more Intents you can use by googleing (loading a playlist, etc.).
-
1Note, this is far from "controlling music application" in terms of OP's question – Marcin Orlowski Aug 25 '12 at 11:55
-
the OP has an idea and seeks for solutions. I am entirely not sure if "control" is meant literally. – sschrass Aug 25 '12 at 12:31
-
See this portion of his question "player should change music next one", which I assume referes to playlist entry. – Marcin Orlowski Aug 25 '12 at 23:54