Getting Started - Android
Getting Started
Choosing a tutorial
It seemed like the tutorials out there are pretty limited. I started with the one from Android Authority, but it's missing quite a lot. Luckily someone has linked a complete video in the comments, but you don't want to watch a half hour video, do you? Best to just jump to their source code.Below I try to detail all the missing steps. Let me know if I've forgotten anything.
Creating Project
When you create the project, select "Add no Activity".Missing imports
If you're new to Android, it often helps to have the imports.import android.inputmethodservice.InputMethodService;
import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputConnection;
Add the missing Android.Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tapastalk.keyboard.konjugationkeyboard">
<application android:allowbackup="true"
android:icon="@mipmap/ic_launcher" android:label="@string/app_name"
android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true"
android:theme="@style/AppTheme">
<service
android:name=".MyInputMethodService"
android:label="MyInputMethodService"
android:permission="android.permission.BIND_INPUT_METHOD">
<meta-data android:name="android.view.im" android:resource="@layout/method"/>
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
</service>
</application>
</manifest>
Modifying the configuration
Run..Edit Configurations, Launch:NothingCompiling and installing
You'll now need to compile and install. Mine no long compiles in Android Studio, but the command line works.
./gradlew assemblerelease
adb install app/build/outputs/apk/release/app-release.apk
Selecting the keyboard
On your phone, you're going to have to enable your keyboard. Go to Settings and search for 'keyboard' and select 'Manage keyboards' (Languages & input > Virtual keyboard > Manage keyboards. You should see your keyboard there - enable it.Now switch to an app like WhatsApp or Messenger. Go to write a message and the normal keyboard should pop up. On the bottom right - below the keyboard - there's a tiny keyboard icon. Select it and switch to your keyboard.
Comments
Post a Comment