This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

service for ping the server in android

Hello

I'm working with android ICS AOSP. i want to create a simple service for check the server whether its alive or not. I need help for following process
  1. Create simple service  for check the server whether its alive or not.
  2. I've to add in AOSP ( Frameworks/base/services/java/com/android/....) How to add the service *.JAVA file into this and how to invoke the file.
  3. I need to call the service from different application for check the server whether its alive or not reachable.
 What are the steps i've to do for it, I'm new to android service.
Note: I don't want to create the service in application, i want to create and use the service like android service ( Ex; vibrator service, mount service, battery service)
 Can any one help me to do this..?
Thanks in advance.