i have did this before ,first of all , if you need to connect your android application with php service at localhost.following thing need following thing
- Android Emulator on which application install
- For SERVER -- WAMP or XAMP Server install on Local machine on which you are testing .
now host your php service in the www folder (in case of WAMP) or in the htdocs folder( in case of XAMP).
Now how to communicate between web service and android : as describe below
Now you have Envoirnment set now all you have to do is to follow this tutorial it will definatly resolve your issue .
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/