algo with phonegap