Question

Hello fellow programmers!

During xmas holidays I started working on a crossword app and thoroughly tested it on my Samsung Galaxy S2, as it was the only device I had at that time. Now back at work I also have an Acer Iconia and Kindle Fire HD to work with. The problem is that my app looks totally blurred on either tablet.

My app doesn't use any pre-made images, everything is drawn from xml drawables (gradients mostly). Though it shouldn't be necessary, I copied all xml gradients to all dpi folders (ldpi, mdpi, hdpi, xhdpi). I also explicitly added the supports-screens tag in manifest, with smallscreens to xlargescreens and anydensity. Nothing worked.

My drawing routine looks like this:

canvas.save();
canvas.translate(mPosX, mPosY);
canvas.scale(zoom, zoom,centerx,centery);
for(int x=0;x<mapsize;x++) 
    for(int y=0;y<mapsize;y++) {
        this.gc.setBounds(cells[x][y]);
        this.gc.draw(canvas);
    }
canvas.restore();

On start I find out the smallest side of a device (800x480 = 480), divide it by the number of cells in my crossword (15), so I get a cellsize of 32 for the S2. The I just draw 15x15 tiles with a size of 32x32 each. This look sharp on my mobile, even if I zoom in 15 times, the text and graphics just stay sharp. Not on the tablets, the graphics are blurry from start and get worse the more I zoom in. On the Acer Iconia the arrows are not even drawn, they are all cluttered in the top left corner, though Logcat says the offset is computed right, they just dont seem to get drawn anywhere else. One thing I recognized is when I start the app on the Acer Iconia, Logcat also says

01-07 11:39:35.292: D/libEGL(7914): loaded /system/lib/egl/libEGL_tegra.so

01-07 11:39:35.292: E/(7914): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!

01-07 11:39:35.292: I/(7914): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
01-07 11:39:35.302: I/(7914): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl
01-07 11:39:35.302: D/libEGL(7914): loaded /system/lib/egl/libGLESv1_CM_tegra.so
01-07 11:39:35.302: D/libEGL(7914): loaded /system/lib/egl/libGLESv2_tegra.so
01-07 11:39:35.332: I/(7914): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl
01-07 11:39:35.332: D/OpenGLRenderer(7914): Enabling debug mode 0

It seems there are problems with loading some drivers, anybody knows more about this? Couldn't find much about it on the web.

And finally some pictures, which say more than 1000 words.

Sharp http://imageshack.us/photo/my-images/338/crosswords21.png http://imageshack.us/photo/my-images/593/crosswords22.png/ Samsung Galaxy S2

Blurred, arrows at right positions http://imageshack.us/photo/my-images/850/crosswordkindle1.png http://imageshack.us/photo/my-images/252/crosswordkindle2.png/ Kindle Fire HD

Blurred, arrows cluttered in top left http://imageshack.us/photo/my-images/259/crosswordiconia1.png http://imageshack.us/photo/my-images/803/crosswordiconia2.png/ Acer Iconia

Please help me :) Thx in advance.

Just found this All the text in my android application gets blurred. Seems to be a common problem with the Iconia Tab.

Was it helpful?

Solution

As it seems on the Kindle and Iconia the application hardwareaccelerated tag seems to be activated automatically. When set to false, the graphics become crips and clear again. It's a bit slower now (obviously) but it works. In contrary, when I turn on hardwareacceleration on the S2, the image becomes blurred like on the tablets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top