Use the ABS api from javascript.  This is particularly built for phonegap use.