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
Yes, you need to use createSpeechRecognizer(Context context, ComponentName serviceComponent)
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
<activity android:name="VoiceServiceStarterActivity">
<intent-filter>
<action android:name="android.speech.action.RECOGNIZE_SPEECH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
...
</activity>
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.