Friday, July 8, 2011

Creating an Input Method

To create an input method (IME) for entering text into text fields and other Views, you need to extend android.inputmethodservice.InputMethodService. This API provides much of the basic implementation for an input method, in terms of managing the state and visibility of the input method and communicating with the currently visible activity.

A good starting point would be the SoftKeyboard sample code provided as part of the SDK. Modify this code to start building your own input method.

An input method is packaged like any other application or service. In the AndroidManifest.xml file, you declare the input method as a service, with the appropriate intent filter and any associated meta data:

 

Copyright 2007 - 2011 Android Developers Blog. All Rights Reserved. Powered by Android Developers - Contact us - Disclaimer - Privacy Policy