Day: November 12, 2013
-
the little things I learned today about Android/Cordova/PhoneGap
For work, I had to help test a cordova iOS app and port it for Android. For some reason, the usual deviceready code wasn’t working: if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) { // is on PhoneGap $(function() { document.addEventListener(“deviceready”, deviceIsReady, false); }); } else { // not on PhoneGap } Instead, this worked: if ( window.device ) { document.addEventListener(“deviceready”,…