There are several apps available today that allow one to draw freely on your touch screen smartphone. Be it to take notes, annotate photographs, capture signatures digitally or to play games like the popular OMGPOP Draw Something App.
Anyone delving into Android game development with Box2D physics will at some time struggled with seemingly random crashes when adding or removing bodies from the physics world. The instinctive thing to do is to destroy the object when some type of event has occurred, such as a touch event or collision in the physics simulation, however simply removing entities from the simulation can cause the simulation to crumble.
In this article I’ll go through my preferred method of safely adding and removing objects from the physics simulation with the minimum performance hit.