added phonegap detection, support on deviceready event