Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:08:56+00:00 2026-06-08T02:08:56+00:00

The official introduction to Text-To-Speech in Android says that upon creating your activity, a

  • 0

The official introduction to Text-To-Speech in Android says that “upon creating your activity, a good first step is to check for the presence of the TTS resources with the corresponding intent:”

Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);

But @gregm in this thread suggests otherwise:

Also, don’t use the ACTION_CHECK_TTS_DATA Intent, that’s awkward to
use
.

Instead, do the following:

  1. Create TextToSpeech
  2. OnInit, check isLanguageAvailable() if it is, your app is all set. if not, send the ACTION_INSTALL_TTS_DATA

If I understand correctly, what @gregm does/suggests is to defer the TextToSpeech.LANG_MISSING_DATA check from onActivityResult() to onInit().

Why is this better than the formal approach?

And why is ACTION_CHECK_TTS_DATA so “awkward to use”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:08:58+00:00Added an answer on June 8, 2026 at 2:08 am

    This is @gregm.

    ACTION_CHECK_TTS_DATA requires more complicated execution and more code, but yet does the same thing as TextToSpeech.isLanguageAvailable() Let me explain:

    1) You need TWO asynchronous processes when you use ACTION_INSTALL_TTS_DATA. First, to launch an Intent and receive the result. Second, to wait for TextToSpeech to call onInit() More can go wrong while your app is doing all that waiting.

    2) All you are trying to do is execute an if statement and you need the same code to handle installing the language data if need be, so why bother adding extra complexity?

    It boils down do this:

    Do you want 1 line of code:

    if (TextToSpeech.isLanguageAvailable())
    {
     (same tts init code here)
    }
    

    or >1 lines of code like:

    Intent checkIntent = new Intent();
    checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
    startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
    
    public void onActivityResult(...)
    {
     if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)
     (same tts init code here)
    }
    

    In my point of view, I’d rather just get to the if statement, instead of using an Intent runaround. I believe the official Android documentation needs to change to recommend this approach.

    If you still don’t believe that both approaches we are discussing do the same exact thing, check out the alternative implementations I have here and here. Also, If you don’t care about all this stuff and just want your app to speak, just extend this Activity and be done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

official android dev website says that:「You can implement your tab content in one of
The official documentation says that Your application must have a local Service to facilitate
Official appengine documentation says that if we set threadsafe property to true in app.yaml
Official Mono project website says that Mono works successfully on Windows, Linux and Mac
The official data sheet of Microsoft Surface says that there is no audio input
The official docs says that smarty has 'while' support . However I do in
Official Javadoc says that Math.floor() returns a double that is equal to a mathematical
Official guide says: Tomcat deployment is trivial and requires copying the WAR file into
On the official Selenium blog ( http://seleniumhq.wordpress.com/ ) it mentions that Maven is no
The Code is from the ember.js official introduction: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.