title: Subpixel positioning/rendering of views on Android
body: <p>On Android 3.0 and above it's possible to specify the absolute position of a View using the setX / setY methods (or setTranslationX / setTranslationY). These methods take a float parameter.</p>
  
  <p>While it's possible to specify the position of a view in subpixel coordinates, it seems that Android won't actually render the View using the fractional part of the coordinates, at least not by default.</p>
  
  <p>This is different from the behavior on iOS, which can be seen in the image below (scaled up 400%):</p>
  
  <p><img src="https://i.stack.imgur.com/tvzdI.png" alt="example"></p>
  
  <p>Here I've added two UIImageViews (iOS) / ImageViews (Android). The upper one is positioned using whole integer coordinates, while the bottom one is positioned using half-pixel coordinates. On Android the View is clearly snapped to the nearest integer coordinates before rendering. Is it possible to get the same behavior as on iOS?</p>
  
  <p>I'll admit that in this specific example Android gives the best visual quality. But my motivation for trying to enable subpixel rendering is to achieve smoother animations (when translating a view between two coordinates). Especially for slow animations on low/medium DPI-devices it's quite noticeable that the View is always snapped to the nearest integer coordinate during the animation. On iOS animations like this always appear silky smooth.</p>
  
  <p>This is for a game by the way. It's so simple graphically that I'd like to avoid using OpenGL if possible, but I'm not willing to give up the silky smooth 60fps animations I can get on iOS.</p>