Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if user's keyboard is 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?

like image 744
Arci Avatar asked Jan 17 '13 01:01

Arci


People also ask

What is a Swype keyboard?

Swype replaces your Android phone's on-screen keyboard with a slightly strange-sounding alternative: Rather than tapping keys individually, you slide your finger around your screen — without ever lifting it — to input the words you want.

Does Swype keyboard still exist?

In February 2018, the Android app was pulled from the Play Store. The iOS app was also pulled from the App Store. Starting from 2018, users have to use Aptoide to download the full version of Swype. In late February 2018, the full version of Swype was discontinued.

How do I detect if software keyboard is visible on Android device or not?

Android provides no direct way to determine if the keyboard is open, so we have to get a little creative. The View class has a handy method called getWindowVisibleDisplayFrame from which we can retrieve a rectangle which contains the portion of the view visible to the user.


2 Answers

You can retrieve the current default keyboard using:

String currentKeyboard =  Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);

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).

like image 92
Raghav Sood Avatar answered Sep 21 '22 04:09

Raghav Sood


Looks like your answer is here:

How to determine the current IME in Android?

Sometimes it's just about knowing the right search term.

like image 28
anthropomo Avatar answered Sep 19 '22 04:09

anthropomo