title: How to check whether Google TTS voice data installed for Hindi Language
body: <p>I am using Google TTS Engine for Text-to-speech for Hindi Language.</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      switch (requestCode) {
      case ACTIVITY_TTS_PASS:
          if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
              tts = new TextToSpeech(getApplicationContext(), this);
              int availability = tts.isLanguageAvailable(new Locale("hin-IND"));
              switch(availability) {
              case TextToSpeech.LANG_AVAILABLE:
                  Log.d("TTS", "Language available");
                  break;
              case TextToSpeech.LANG_NOT_SUPPORTED:
                  Log.d("TTS", "Language not supported");
  
                  Intent installTTSIntent = new Intent();
                  installTTSIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                  ArrayList&lt;String&gt; languages = new ArrayList&lt;String&gt;();
                  languages.add("hin-IND"); // hin - hindi, IND - INDIA
                  installTTSIntent.putStringArrayListExtra(
                          TextToSpeech.Engine.EXTRA_CHECK_VOICE_DATA_FOR, languages);
                  startActivity(installTTSIntent);
                  break;
              case TextToSpeech.LANG_MISSING_DATA:
                  Log.d("TTS", "Language missing data");
                  break;
              case TextToSpeech.LANG_COUNTRY_AVAILABLE:
                  Log.d("TTS", "Contry available");
                  break;
              default:
                  Log.d("TTS", "default");
              }
          }
          else {
              Log.d("TTS", "fail");
              Intent installTTSIntent = new Intent();
              installTTSIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
              ArrayList&lt;String&gt; languages = new ArrayList&lt;String&gt;();
              languages.add("hin-IND"); // hin - hindi, IND - INDIA
              installTTSIntent.putStringArrayListExtra(
                      TextToSpeech.Engine.EXTRA_CHECK_VOICE_DATA_FOR, languages);
              startActivity(installTTSIntent);
          }
  
          break;
      default:
          Log.d("TTS", "case default");
          break;
      }
      super.onActivityResult(requestCode, resultCode, data);
  
  }
  </code></pre>
  
  <p>This is how i can check whether TTS data is installed and Hindi language is supported or not.
  This Intent gives option to install voice data for some languages. Then i selected Hindi (India) and installed.</p>
  
  <p>Even after that
      tts.isLanguageAvailable(new Locale("hin-IND"));
  returns TextToSpeech.LANG_NOT_SUPPORTED.</p>
  
  <p>Also tried with "hi-IN" instead "hin-IND", it gives the same result.
  Now voice data is installed but how can i check it by code ?</p>