diff --git a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java
new file mode 100644
index 0000000..b119d6c
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.compat;
+
+import android.os.Build;
+import android.view.inputmethod.InputMethodSubtype;
+
+import java.lang.reflect.Constructor;
+
+public final class InputMethodSubtypeCompatUtils {
+    private static final String TAG = InputMethodSubtypeCompatUtils.class.getSimpleName();
+    // Note that InputMethodSubtype(int nameId, int iconId, String locale, String mode,
+    // String extraValue, boolean isAuxiliary, boolean overridesImplicitlyEnabledSubtype, int id)
+    // has been introduced in API level 17 (Build.VERSION_CODE.JELLY_BEAN_MR1).
+    private static final Constructor<?> CONSTRUCTOR_INPUT_METHOD_SUBTYPE =
+            CompatUtils.getConstructor(InputMethodSubtype.class,
+                    Integer.TYPE, Integer.TYPE, String.class, String.class, String.class,
+                    Boolean.TYPE, Boolean.TYPE, Integer.TYPE);
+    static {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            if (CONSTRUCTOR_INPUT_METHOD_SUBTYPE == null) {
+                android.util.Log.w(TAG, "Warning!!! Constructor is not defined.");
+            }
+        }
+    }
+    private InputMethodSubtypeCompatUtils() {
+        // This utility class is not publicly instantiable.
+    }
+
+    public static InputMethodSubtype newInputMethodSubtype(int nameId, int iconId, String locale,
+            String mode, String extraValue, boolean isAuxiliary,
+            boolean overridesImplicitlyEnabledSubtype, int id) {
+        if (CONSTRUCTOR_INPUT_METHOD_SUBTYPE == null
+                || Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            return new InputMethodSubtype(nameId, iconId, locale, mode, extraValue, isAuxiliary,
+                    overridesImplicitlyEnabledSubtype);
+        }
+        return (InputMethodSubtype) CompatUtils.newInstance(CONSTRUCTOR_INPUT_METHOD_SUBTYPE,
+                nameId, iconId, locale, mode, extraValue, isAuxiliary,
+                overridesImplicitlyEnabledSubtype, id);
+    }
+}
diff --git a/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java b/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java
index ff332cd..d87f6f3 100644
--- a/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/AdditionalSubtypeUtils.java
@@ -25,6 +25,7 @@
 import android.text.TextUtils;
 import android.view.inputmethod.InputMethodSubtype;
 
+import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils;
 import com.android.inputmethod.latin.Constants;
 import com.android.inputmethod.latin.R;
 
@@ -143,12 +144,17 @@
         // from the current users. So, you should be really careful to change it.
         final int subtypeId = getInputMethodSubtypeId(nameId, localeString, layoutExtraValue,
                 additionalSubtypeExtraValue);
-        // TODO: Use InputMethodSubtypeBuilder once we use SDK version 19.
-        return new InputMethodSubtype(nameId, R.drawable.ic_ime_switcher_dark,
-                localeString, KEYBOARD_MODE, layoutExtraValue + "," + additionalSubtypeExtraValue
-                        + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE
-                        + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE, false, false,
-                        subtypeId);
+        final String extraValue;
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            extraValue = layoutExtraValue + "," + additionalSubtypeExtraValue
+                    + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE
+                    + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE;
+        } else {
+            extraValue = layoutExtraValue + "," + additionalSubtypeExtraValue;
+        }
+        return InputMethodSubtypeCompatUtils.newInputMethodSubtype(nameId,
+                R.drawable.ic_ime_switcher_dark, localeString, KEYBOARD_MODE, extraValue,
+                false, false, subtypeId);
     }
 
     private static int getInputMethodSubtypeId(int nameId, String localeString,
