diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java
index b9b6362..0ab84f7 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java
@@ -36,6 +36,7 @@
 import com.android.inputmethod.keyboard.Keyboard;
 import com.android.inputmethod.keyboard.KeyboardView;
 import com.android.inputmethod.latin.CollectionUtils;
+import com.android.inputmethod.latin.CoordinateUtils;
 
 /**
  * Exposes a virtual view sub-tree for {@link KeyboardView} and generates
@@ -62,7 +63,7 @@
     private final Rect mTempBoundsInScreen = new Rect();
 
     /** The parent view's cached on-screen location. */
-    private final int[] mParentLocation = new int[2];
+    private final int[] mParentLocation = CoordinateUtils.newInstance();
 
     /** The virtual view identifier for the focused node. */
     private int mAccessibilityFocusedView = UNDEFINED;
@@ -180,7 +181,8 @@
 
             // Calculate the key's in-screen bounds.
             mTempBoundsInScreen.set(boundsInParent);
-            mTempBoundsInScreen.offset(mParentLocation[0], mParentLocation[1]);
+            mTempBoundsInScreen.offset(
+                    CoordinateUtils.x(mParentLocation), CoordinateUtils.y(mParentLocation));
 
             final Rect boundsInScreen = mTempBoundsInScreen;
 
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 472f74b..d7cb5aa 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -45,6 +45,7 @@
 import com.android.inputmethod.keyboard.internal.PreviewPlacerView;
 import com.android.inputmethod.latin.CollectionUtils;
 import com.android.inputmethod.latin.Constants;
+import com.android.inputmethod.latin.CoordinateUtils;
 import com.android.inputmethod.latin.LatinImeLogger;
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
@@ -134,7 +135,7 @@
 
     // Preview placer view
     private final PreviewPlacerView mPreviewPlacerView;
-    private final int[] mCoordinates = new int[2];
+    private final int[] mCoordinates = CoordinateUtils.newInstance();
 
     // Key preview
     private static final int PREVIEW_ALPHA = 240;
@@ -832,10 +833,10 @@
             // In transient state.
             return;
         }
-        final int[] viewOrigin = new int[2];
+        final int[] viewOrigin = CoordinateUtils.newInstance();
         getLocationInWindow(viewOrigin);
         final DisplayMetrics dm = getResources().getDisplayMetrics();
-        if (viewOrigin[1] < dm.heightPixels / 4) {
+        if (CoordinateUtils.y(viewOrigin) < dm.heightPixels / 4) {
             // In transient state.
             return;
         }
@@ -850,7 +851,8 @@
             Log.w(TAG, "Cannot find android.R.id.content view to add PreviewPlacerView");
         } else {
             windowContentView.addView(mPreviewPlacerView);
-            mPreviewPlacerView.setKeyboardViewGeometry(viewOrigin[0], viewOrigin[1], width, height);
+            mPreviewPlacerView.setKeyboardViewGeometry(
+                    CoordinateUtils.x(viewOrigin), CoordinateUtils.y(viewOrigin), width, height);
         }
     }
 
@@ -940,7 +942,8 @@
         // parent key. If it doesn't fit in this {@link KeyboardView}, it is moved inward to fit and
         // the left/right background is used if such background is specified.
         final int statePosition;
-        int previewX = key.getDrawX() - (previewWidth - keyDrawWidth) / 2 + mCoordinates[0];
+        int previewX = key.getDrawX() - (previewWidth - keyDrawWidth) / 2
+                + CoordinateUtils.x(mCoordinates);
         if (previewX < 0) {
             previewX = 0;
             statePosition = STATE_LEFT;
@@ -952,7 +955,8 @@
         }
         // The key preview is placed vertically above the top edge of the parent key with an
         // arbitrary offset.
-        final int previewY = key.mY - previewHeight + mPreviewOffset + mCoordinates[1];
+        final int previewY = key.mY - previewHeight + mPreviewOffset
+                + CoordinateUtils.y(mCoordinates);
 
         if (background != null) {
             final int hasMoreKeys = (key.mMoreKeys != null) ? STATE_HAS_MOREKEYS : STATE_NORMAL;
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index 9c450e9..a698b0b 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -26,6 +26,7 @@
 import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
 import com.android.inputmethod.latin.Constants;
+import com.android.inputmethod.latin.CoordinateUtils;
 import com.android.inputmethod.latin.InputPointers;
 import com.android.inputmethod.latin.R;
 
@@ -34,7 +35,7 @@
  * detecting key presses and touch movements.
  */
 public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel {
-    private final int[] mCoordinates = new int[2];
+    private final int[] mCoordinates = CoordinateUtils.newInstance();
 
     private final KeyDetector mKeyDetector;
 
@@ -169,7 +170,7 @@
         window.setHeight(container.getMeasuredHeight());
         parentView.getLocationInWindow(mCoordinates);
         window.showAtLocation(parentView, Gravity.NO_GRAVITY,
-                x + mCoordinates[0], y + mCoordinates[1]);
+                x + CoordinateUtils.x(mCoordinates), y + CoordinateUtils.y(mCoordinates));
 
         mOriginX = x + container.getPaddingLeft();
         mOriginY = y + container.getPaddingTop();
diff --git a/java/src/com/android/inputmethod/latin/CoordinateUtils.java b/java/src/com/android/inputmethod/latin/CoordinateUtils.java
new file mode 100644
index 0000000..cd31772
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/CoordinateUtils.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 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.latin;
+
+public final class CoordinateUtils {
+    private static final int INDEX_X = 0;
+    private static final int INDEX_Y = 1;
+    private static final int ARRAY_SIZE = INDEX_Y + 1;
+
+    private CoordinateUtils() {
+        // This utility class is not publicly instantiable.
+    }
+
+    public static int[] newInstance() {
+        return new int[ARRAY_SIZE];
+    }
+
+    public static int x(final int[] coords) {
+        return coords[INDEX_X];
+    }
+
+    public static int y(final int[] coords) {
+        return coords[INDEX_Y];
+    }
+}
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
index 6cdd9e2..8cc09f3 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
@@ -34,6 +34,7 @@
 import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
 import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler;
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
+import com.android.inputmethod.latin.CoordinateUtils;
 import com.android.inputmethod.latin.R;
 
 /**
@@ -41,7 +42,7 @@
  * key presses and touch movements.
  */
 public final class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
-    private final int[] mCoordinates = new int[2];
+    private final int[] mCoordinates = CoordinateUtils.newInstance();
 
     final KeyDetector mModalPanelKeyDetector;
     private final KeyDetector mSlidingPanelKeyDetector;
@@ -163,7 +164,7 @@
         window.setHeight(container.getMeasuredHeight());
         parentView.getLocationInWindow(mCoordinates);
         window.showAtLocation(parentView, Gravity.NO_GRAVITY,
-                x + mCoordinates[0], y + mCoordinates[1]);
+                x + CoordinateUtils.x(mCoordinates), y + CoordinateUtils.y(mCoordinates));
 
         mOriginX = x + container.getPaddingLeft();
         mOriginY = y + container.getPaddingTop();
