0

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?

2 Answers 2

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.).

3
  • 1
    Note, this is far from "controlling music application" in terms of OP's question Aug 25, 2012 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, 2012 at 12:31
  • See this portion of his question "player should change music next one", which I assume referes to playlist entry. Aug 25, 2012 at 23:54
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.