I created a simple speech recognition service: for this purpose I created a subclass of android.speech.RecognitionService and I created an activity to start and
If you want queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0) to pick up your activity (VoiceServiceStarterActivity) then you have to declare in your app's Manifest that this activity handles RecognizerIntent.ACTION_RECOGNIZE_SPEECH, like this
...
For more concrete code have a look at the project Kõnele (source code) which is essentially an open source implementation of the interfaces via which speech recognition is provided on Android, i.e. it covers:
and uses open source speech recognition servers.