The Android SDK includes input method framework classes that enable interested developers to use powerful input methods as well as create their own input methods, such as custom software keyboards and other Input Method Editors (IMEs). Users can download custom IMEs to use on their devices. For example, there’s nothing stopping a developer from creating a custom keyboard with Lord of the Rings-style Elvish characters, smiley faces, or Greek symbols.
Working with Software Keyboards
Because text input methods are locale-based (different countries use different alphabets and keyboards) and situational (numeric vs. alphabetic vs. special keys), the Android platform has trended toward software keyboards as opposed to relying on hardware manufacturers to deliver specialized hardware keyboards.
Choosing the Appropriate Software Keyboard
The Android platform has a number of software keyboards available for use. One of the easiest ways to enable your users to enter data efficiently is to specify the type of input expected in each text input field.
For example, to specify an EditText that should take only capitalized textual input, you could set the inputType attribute as follows:<EditText android:layout_height="wrap_content"
This shows a number of EditText controls with different inputType configurations.
EditText Controls with different input types.
The input type dictates which software keyboard is used by default and it enforces appropriate rules, such as limiting input to certain characters. Figure (left) illustrates what the software keyboard looks like for an EditText control with its inputType attribute set to all capitalized text input. Note how the software keyboard keys are all capitalized. If you were to set the inputType to textCapWords instead, the keyboard switches to lowercase after the first letter of each word and then back to uppercase after a space. Figure (middle) illustrates what the software keyboard looks like for an EditText control with its inputType attribute set to number. Figure (right) illustrates what the software keyboard looks like for an EditText control with its inputType attribute set to textual input, where each sentence begins with a capital letter and the text can be multiple lines.
The software keyboards associated with specific input types.
Depending on the user’s keyboard settings (specifically, if the user has enabled the Show Suggestions and Auto-complete options in the Android Keyboard settings of his device), the user might also see suggested words or spelling fixes while typing.
For a complete list of inputType attribute values and their uses, see http://developer. android.com/reference/android/R.attr.html#inputType.
For more fine-tuned control over input methods, see the android. view. inputmethod. InputMethod Manager class.
Providing Custom Software Keyboards
If you are interested in developing your own software keyboards, we highly recommend the following references:
Working with Text Prediction and User Dictionaries
Text prediction is a powerful and flexible feature available on Android devices. We’ve already talked about many of these technologies in other parts of this book, but they merit mentioning in this context as well.
Setting Up Your Android Development Environment
Writing Your First Android Application
Understanding The Anatomy Of An Android Application
Defining Your Application Using The Android Manifest File
Managing Application Resources
Exploring User Interface Screen Elements
Designing User Interfaces With Layouts
Drawing And Working With Animation
Using Android Data And Storage Apis
Sharing Data Between Applications With Content Providers
Using Android Networking Apis
Using Android Web Apis
Using Location-based Services (lbs) Apis
Using Android Multimedia Apis
Using Android Telephony Apis
Using Android 3d Graphics With Opengl Es
Using The Android Ndk
Using Android’s Optional Hardware Apis
Working With Notifications
Working With Services
Extending Android Application Reach
Managing User Accounts And Synchronizing User Data
Handling Advanced User Input
Targeting Different Device Configurations And Languages
The Mobile Software Development Process
Designing And Developing Bulletproof Android Applications
Testing Android Applications
Selling Your Android Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.