1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TextToSpeech#synthesizeToFile()がandroid.permission.WRITE_EXTERNAL_STORAGEを要求するようになってた

Last updated at Posted at 2014-07-30

久しぶりに用事があって、Android API プログラミング・リファレンスのTextToSpeechのサンプルを使ってみたのですが、一部メソッドが失敗するようになってました。

調べてみると、いつの間にかは知りませんが、TextToSpeech#synthesizeToFile()が、android.permission.WRITE_EXTERNAL_STORAGE権限を要求するようになってました。

このメソッドは、読んで字のごとくですが、外部ストレージにスピーチ内容を保存するというものです。外部ストレージにファイルを保存するというものなので当然android.permission.WRITE_EXTERNAL_STORAGE権限が必要なはずなのですが、なぜか執筆当初は権限無しで動作していました。まあ、修正されたのでバグということだと思いますが。

まあ、権限は設定していて損があるものではありませんし、TextToSpeech#synthesizeToFile()を使うときは忘れずにandroid.permission.WRITE_EXTERNAL_STORAGE権限をAndroidManifestに設定しておきましょう。というお話しでした。

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?