如何检测用户的键盘是否为 Swype?

How to detect if user#39;s keyboard is Swype?(如何检测用户的键盘是否为 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
Understanding applicationSignificantTimeChange:(了解 applicationSignificantTimeChange:)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)