You will find some interesting implementation tricks in the following open source project: http://www.b4x.com/forum/showthread.php?t=1514