Posts

Final product!

Image
It's probably no surprise to anyone that I've been making my own custom keyboard. Well, it's now on the App Store and Play Store ! These links also contain screenshots. The Concept I wanted to build a keyboard that would help me write Spanish and French. I created a custom keyboard that conjugates verbs for you and called it Konjugation Keyboard. Here's the video that explains it - less than one minute long.

Modifying the keyboard in Android

You can show and hide rows - kind of. You can't actually modify a keyboard after you've instantiated it with the new keyword. Instead, you can modify it at the time of instantiation:   new Keyboard(this, R.xml.keyboard_layout, R.integer.keyboard_show_extra_row) I put the constant keyboard_show_extra_row in a file called keyboard.xml , but you can actually call that file anything as long as it's in the values folder: <?xml version="1.0" encoding="utf-8"?> <resources>     <integer name=" keyboard_show_extra_row ">1</integer> </resources> and add the constant to the rows that you want controlled by this constant: <Row android:keyboardMode="@integer/keyboard_suggestions">     ... </Row> Then you just instantiate as described above. Modifying after instantiating Apparently you can't modify after instantiation. However, you can create two copies, one created with this flag an

Available Resources for iOS

I'll be adding to this as I go along. Limitations Some articles discussing the limitations of keyboards on iOS. limitations-of-custom-ios-keyboards The Trials and Tribulations... Keyboards available on Github Keyboards that work well on iPhone. You can check out their source code on Github. Lisu Keyboard Tasty Imitation Keyboard I'll be adding to this as I go along.

Lessons in iOS

Building a keyboard in iOS certainly has its challenges. Below I'll be listing some of the lessons I've learned while building my keyboard. Height It turns out that doing something simple like changing the height is quite complicated for iOS keyboards. These links were useful for me: Stack Overflow Some blog Methods we can override So it turns out that  textDidChange  is called when the selection changes and  textDidChange  is never called - go figure! More details here . I'll keep adding here as I go along.

Getting started - iOS

You'll probably want to start with Apple's Custom Keyboard guide .

Settings in Android

I'm not going to teach you how to writing an activity for settings here - that's kind of obvious. Instead I'm going to highlight a couple of interesting things you can do with settings on an Android Keyboard. Opening your settings page We want to be able to open our settings page from two places. From the launcher. Add LAUNCHER to AndroidManifest.xml , like so: <activity android:name=".MainActivity">     <intent-filter>         <action android:name="android.intent.action.MAIN" />         <category android:name="android.intent.category.LAUNCHER" />     </intent-filter> </activity> <service     android:name=".MyInputMethodService"     android:label="Konjugator Keyboard"     android:permission="android.permission.BIND_INPUT_METHOD"     >     <meta-data android:name="android.view.im" android:resource="@layout/method"/>     <intent-filter>

Using React Native in an Android Custom Keyboard

Disclaimer: I'm not very experienced with Android Java. If I've made a mistake, let me know. In this post, I'll show you how I got React Native working in a custom system keyboard in Android. React Native View Let's start with the Create a new file called xml/popup.xml . mReactRootView = new ReactRootView(this); mReactInstanceManager = ReactInstanceManager.builder()         .setApplication(getApplication())         .setBundleAssetName("index.android.bundle")         .setJSMainModulePath("index")         .addPackage(new MainReactPackage())         .setUseDeveloperSupport(BuildConfig.DEBUG)         .setInitialLifecycleState(LifecycleState.RESUMED)         .build(); mReactRootView.startReactApplication(mReactInstanceManager, "MyReactNativeApp", null); Custom Keyboards in Java Structure of your Java: Your service will extend InputMethodService . Your service will return a KeyboardView in onCreateInputView . You create this by inf