Recently I have been experimenting around with textures and openGL for the android phone. Using example code found online I put together something that drew simple sprites, using a square with a texture on it. This was working fine in the emulator, however, when sent to the phone, instead of the texture, there was just a white box. Someone posted a similar problem on stack overflow here. The phone I was using was indeed a Motorola Droid, and replacing
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon2);
with
InputStream is = context.getResources().openRawResource(R.drawable.icon2);
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeStream(is);
} finally {
try {
is.close();
is = null;
} catch (IOException e) {
}
}
did the trick. The textures appeared again.