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?

Community
  • 1
  • 1
PatLas
  • 179
  • 1
  • 5
  • 16

2 Answers2

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

Community
  • 1
  • 1
sschrass
  • 7,014
  • 6
  • 43
  • 62