title: Android OpenGL ES Why JPG texture displays wrongly on some devices?
body: <p>I'm completely new to OpenGl so be kind.
  In my application I'm using JPG and PNG textures. On HTC Desire (android 2.2) or Xperia x8 (android 2.1) everything displays fine, here's the screen: <a href="http://imageshack.us/photo/my-images/534/xperia.png/" rel="nofollow">http://imageshack.us/photo/my-images/534/xperia.png/</a>). But on newer devices such as Samsung Galaxy Tab 10.1 (android 3.2) or Samsung Galaxy S3 (android 4.x) JPG textures are separated by color? and shifted: <a href="http://imageshack.us/photo/my-images/855/samsungbs.png/" rel="nofollow">http://imageshack.us/photo/my-images/855/samsungbs.png/</a> . Still, PNGs always display ok.</p>
  
  <p>I'm using GLSurfaceView for drawing. And my code responsible for making texture looks like this:</p>
  
  <pre><code>gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[i]);
          gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);
          gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
          gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
          gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
          if (bitmaps[i].hasAlpha()) {
              GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, bitmaps[i], 0);
          } else {
              GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGB, bitmaps[i], 0);
          }
  </code></pre>
  
  <p>By "bitmaps[i].hasAlpha()" I'm trying to differentiate whether the given bitmap is jpg or png. Where can I be wrong?</p>