I'm new to this android development.
I've read a lot on the net how to do it, but I can't get the speed I want/expect.
- Code: Select all
In init:
bitmap = Bitmap.createBitmap(WIDTH, HEIGHT, Bitmap.Config.ARGB_8888);
my onDraw method:
protected void onDraw(Canvas canvas) {
// canvas.drawColor(0xFFCCCCCC); //if you want another background color
makeLines();
eval();
for (int j = 0; j < HEIGHT-2; j++) {
int heat = 0;
for (int i = 0; i < WIDTH; i++) {
heat = firebuf[j][i];
bitmap.setPixel(i, j, palbuf[heat]);
}
}
canvas.drawBitmap(bitmap, 0, 0, null);
// refresh the canvas
invalidate();
}
Is this the way to do it?
I come from the PC world, where I would have 2 buffers directly to the gfx card. Write in one while the other is shown and then switch.
Couldn't find out how to do it on the android.


