Hi friends,
i have few queries related to double buffering implementation.

1) Is there any harm in explicitly implementing the double buffering even though
the device implicitly supports it. In the sense i am not using the isDoubleBuffered() API
even though it returned 'true' when i checked it using an sample application in the device.

2) The harm i mentioned here refers to Heap memory consumption as well performance vice.

3) Is there any difference in explicit & implicit implementation of double buffering. Will it
vary according to each & every device.

4) Do we need to rely always only on the implicit implementation of double buffering( assuming
the device supports it implicitly).

Problem Description:

i have written a sample application(Client-Server model) which uses canvas and
connection type i am using is HTTP.
Now this application was working fine(only related to UI i m refering) until i was using
the explicit implementation of double buffering irrespective of whether device implicitly support or
not.
I did the modifications in the application like if the double buffering is implicitly supported
by the device then don't use the explicit implementation.
Finally after these changes when i executed the application it is working fine till the observed
the problem related to UI in the relaunch onwards.
The UI is not getting painted properly.this is happening after selecting the APN settings. In a
distorted manner like blank screen it appears for 5 to 6 secs then everything becomes proper. Now the UI
looks fine.

Code:

protected void paint(Graphics pGraphicsObj) {

if (!isDoubleBuffered()) {
mimageScreenObj = Image.createImage(WIDTH,
HEIGHT);
mgraphicsDBObj = mimageScreenObj.getGraphics();
paintscreen(mgraphicsDBObj);
pGraphicsObj.drawImage(mimageScreenObj, 0, 0, 0);
} else {
paintscreen(pGraphicsObj);
}
}


Thanks,
Sakthivel


See More: Double Buffering Implementation - Clarification Required