How to detect if user#39;s keyboard is Swype?(如何检测用户的键盘是否为 Swype?)
问题描述
是否可以知道用户正在使用的键盘?如何检查用户是否使用 Swype 键盘?
Is it possible to know the keyboard being used by the user? How do I check if the user is using a Swype keyboard?
推荐答案
您可以使用以下方法检索当前的默认键盘:
You can retrieve the current default keyboard using:
String currentKeyboard = Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
您将获得类似 com.touchtype.swiftkey/com.touchtype.KeyboardService 的各种键盘的结果.第一部分是键盘的主包名,第二部分是它使用的Keyboard Service的名称.只需解析这个字符串,看看它是否与 Swype 的信息匹配(我现在只能提供 SwiftKey 的详细信息,因为我没有安装 Swype).
You will get a result like com.touchtype.swiftkey/com.touchtype.KeyboardService for various keyboards. The first part is the main package name of the keyboard, and the second is the name of the Keyboard Service it uses. Simply parse this String to see if it matches the info for Swype (I can only provide SwiftKey's details right now, as I don't have Swype installed).
这篇关于如何检测用户的键盘是否为 Swype?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何检测用户的键盘是否为 Swype?
基础教程推荐
- 新的@SystemApi 注解是什么意思,和@hide 有什么区别 2022-01-01
- Android:STATE_SELECTED不工作 2022-01-01
- 在 appComponent dagger 2 中动态添加测试模块? 2022-01-01
- 如何将多个组件添加到 PickerView? 2022-01-01
- - (CGRect)convertRect:(CGRect)rect toView:(UIView *)view 如何工作 2022-01-01
- 可可/目标C(OSX不是iOS)从子对象访问父对象 2022-01-01
- 在 iOS8 中无法获得正确的键盘高度值 2022-01-01
- 突出显示朗读文本(在 iPhone 的故事书类型应用程序中) 2022-01-01
- 在 Android 模拟器中激活网络位置提供程序? 2022-01-01
- 我的 UIImageView 的任务 2022-01-01
