You can use the many applications already provided in Google Play for what you want. If you are looking to develop this kind of application yourself, then you can take a look here:
And the code that he is provided could be found here:
https://code.google.com/p/android-cookbook/source/browse/#svn/trunk/TunesControl