Here you can find the source of isVoiceSearchServiceExist(Context context)
public static boolean isVoiceSearchServiceExist(Context context)
//package com.java2s; import java.util.List; import android.util.Log; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import android.content.Context; public class Main { static final String TAG = "LIMEUtilities"; static final boolean DEBUG = true; public static boolean isVoiceSearchServiceExist(Context context) { InputMethodManager imm = (InputMethodManager) context .getSystemService(Context.INPUT_METHOD_SERVICE); List<InputMethodInfo> mInputMethodProperties = imm .getEnabledInputMethodList(); boolean isVoiceSearchServiceEnabled = false; for (int i = 0; i < mInputMethodProperties.size(); i++) { InputMethodInfo imi = mInputMethodProperties.get(i); if (DEBUG) Log.i(TAG, "enabled IM " + i + ":" + imi.getId()); if (imi.getId() .equals("com.google.android.voicesearch/.ime.VoiceInputMethodService")) { isVoiceSearchServiceEnabled = true; if (DEBUG) Log.i(TAG,//from ww w . j av a 2s . c o m "isVoiceSearchServiceExist(), voice input service ime found."); break; } } return isVoiceSearchServiceEnabled; } }