2

I have seen applications that manage to add their own checkboxes to system settings without requiring root access.

For example, when a new TTS engine is installed, it adds its own items to the Voice input & output > Text-to-speech settings screen:

enter image description here

How do they do that?

If I want to add my own setting to that Text-to-speech settings screen, what hook, API and/or documentation should I be looking for?

Community
  • 1
  • 1
an00b
  • 11,338
  • 13
  • 64
  • 101

1 Answers1

3

How do they do that?

By examining the TtsEngine sample app in the SDK, it would appear that the process is:

Step #1: Implement a TTS service. Developers who attempt to use this facility to hook arbitrary other stuff into Settings will be shot on sight.

Step #2: In the manifest entry for that service, have a <meta-data> element with android:name="android.speech.tts" and an android:resource attribute pointing to an XML resource.

Step #3: Create the aforementioned XML resource, akin to the following:

<tts-engine xmlns:android="http://schemas.android.com/apk/res/android"
  android:settingsActivity="your.settings.activity.GoesHere" />

Alas, this appears to be undocumented. Leastways, I'm not finding any references to this stuff when I search the online developer guide.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Wow. You are faster than a lightening/usain bolt. Thanks! – an00b Aug 23 '12 at 17:18
  • @an00b: No problem. BTW, there are similar hooks for accessibility services and input method editors, and those are documented. So, basically, the "add my own stuff to Settings" is only supported for specific things, particularly things that might not need their own separate UI anywhere else. – CommonsWare Aug 23 '12 at 17:19