All,
I cannot find any threads where this issue has been brought up before, so I must be missing something ridiculously easy. I’m new to android and am playing around with creating an inputmethod. I yanked out all of the android code for the lock screen and when I view it on the emulator or on a Samsung Galaxy, the fonts on the buttons look perfect. But when I look at them on my HTC Sensation, everything is terribly pixelated. At first I thought the problem was with the sym_keyboard_numX image files, but I tested two things to make sure that wasn’t the case:
- I originally had both hdpi and mdpi images for those. I removed the mdpi images leaving only the hdpi to ensure the wrong images weren’t being loaded.
- I tried using a
keyLabelinstead of the images for the numbers and the text is still terribly pixelated.
I’ve looked through all of the code looking for any values that could affect quality and can’t find anything. I appreciate any help!
Here is the xml file defining the keyboard. You will see that I am using keyLabels in most of the buttons with a few keyIcons to test the difference. As I said, there is no difference. I don’t know of any other code that would be useful for you.
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, 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.
*/
-->
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="33.33%p"
android:horizontalGap="2px"
android:verticalGap="0px"
android:keyHeight="@dimen/password_keyboard_key_height"
>
<Row>
<Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"/>
<Key android:codes="50" android:keyLabel="2"/>
<Key android:codes="51" android:keyLabel="3"/>
</Row>
<Row>
<Key android:codes="52" android:keyLabel="4" android:keyEdgeFlags="left"/>
<Key android:codes="53" android:keyIcon="@drawable/sym_keyboard_num5"/>
<Key android:codes="54" android:keyLabel="6"/>
</Row>
<Row>
<Key android:codes="55" android:keyLabel="7" android:keyEdgeFlags="left"/>
<Key android:codes="56" android:keyLabel="8"/>
<Key android:codes="57" android:keyLabel="9"/>
</Row>
<Row android:rowEdgeFlags="bottom">
<Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok"/>
<Key android:codes="48" android:keyLabel="0"/>
<Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete"
android:iconPreview="@drawable/sym_keyboard_feedback_delete"
android:isRepeatable="true" android:keyEdgeFlags="right"/>
</Row>
</Keyboard>
Apparently this question has come up before but I never came across it in all of my searching. Probably just the wrong search terms. I even went through all of the stackoverflow suggestions before posting my question, but one of the
Relatedposts had my answer: https://stackoverflow.com/questions/6496870/assets-look-grainy-pixelated?rq=1Basically I had to add a
minSdkVersion(targetSdkVersion?) and thesupports-screensas follows:<supports-screens android:resizeable="true" android:largeScreens="true"/><uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>