I am trying to create a service that listens Volume key events.
Whenever the volume key presses, the service should send an sms to a number, but I can't detect volume key event.
You can use an OnKeyListener which can detect keyevents (including volume keys). You can find the keycodes here. Good Luck!
As far as I understand, you can not listen for key presses directly in a service (see this question).
On an unrelated note, it is hard for me to think of a reason to do what you want aside from writing malware.