android TTS install language if not exist
<p>i Try to use <code>JAPANESE</code> language on my Android 4 device.</p>

<pre><code>int value = tts.setLanguage(Locale.JAPANESE);
</code></pre>

<p>but value is -2.</p>

<p>this is my code for checking</p>

<pre><code>protected void check(int requestCode, int resultCode, Intent data) {
        if (requestCode == 0) {
            switch (resultCode) {
            case TextToSpeech.Engine.CHECK_VOICE_DATA_PASS:
                tts = new TextToSpeech(this, this);
                break;
            case TextToSpeech.Engine.CHECK_VOICE_DATA_BAD_DATA:
            case TextToSpeech.Engine.CHECK_VOICE_DATA_MISSING_DATA:
            case TextToSpeech.Engine.CHECK_VOICE_DATA_MISSING_VOLUME:
                Intent installIntent = new Intent();
                installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                startActivity(installIntent);
                break;
            case TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL:
            default:
                Log.e(TAG, "Got a failure. TTS not available");
            }
        }
    }
</code></pre>

<p>and i want to install language if not exist. But app crashes. Is this correct wy ir what can i do? How to get japanese language?</p>
