————–> +1 Google if you want to help other devs to fix that issue <————–

You might have seen that gradiants on boxes and on backgrounds are quite ulgly…

Indeed Android rendering in 16 bit is quite tricky… because I need 24 bits for my png !

And so I needed to go for true RGBA_8888 !

In short, I found how to fix it.

Well watch the result and compare to your device :

For those who search how to do that on AndEngine, I found the solution on the AndEngine forum creating this class as root of my game Activities :

public abstract class MyGameActivity extends LayoutGameActivity{

protected void onSetContentView() {


this.mRenderSurfaceView = (RenderSurfaceView) this.findViewById(this.getRenderSurfaceViewID());



For standard Android application, I use :

public abstract class RgbaActivity extends Activity{

//permet d’activer le support d’activity aux fenêtres 32 bits pour éviter les pbs de Bandering
public void onAttachedToWindow() {
Window window = getWindow();

you can also use dithering on drawable using XML :

android:dither= »true »;

but the results aren’t as good as the method above.

Finally you can activate dither using java by getting the drawable through Drawable d = getResources().getDrawable(R.drawable.ss_background);

and use d.setDither(true);

For backgrounds gradient, use something like this :

View l = findViewById(R.id.rLayout1);

Hope this will be useful for some people 🙂