Android WebView renders blank/white, view doesn’t update on css changes or HTML changes, animations are choppy

Note: There’s a better solution as of Android 4.4+. It’s a drop-in WebView replacement called CrossWalk. It uses the latest Chromium-kit and it’s fantastic. You can read up about it here: crosswalk-project.org Also, it appears that since Android 4.4, the invalidate() solution is no longer necessary and you can get away with using some of … Read more

“No Content-Security-Policy meta tag found.” error in my phonegap application

After adding the cordova-plugin-whitelist, you must tell your application to allow access all the web-page links or specific links, if you want to keep it specific. You can simply add this to your config.xml, which can be found in your application’s root directory: Recommended in the documentation: <allow-navigation href=”http://example.com/*” /> or: <allow-navigation href=”http://*/*” /> From … Read more

Android ADT error, dx.jar was not loaded from the SDK folder

This is caused by incomplete/messy upgrade to latest version which results in dx.jar missing from {Android SDK dir}\platform-tools\lib\. Solution: Find your latest dx.jar in {Android SDK dir}\platforms\* and copy it to: {Android SDK dir}\platform-tools\lib\ Restart eclipse, clean your project and everything should work as expected. (If platform-tools\lib directory is missing entirely you will have to … Read more

Override Android Backbutton behavior only works on the first page with PhoneGap

I gone through the new Phonegap source code and did following changes to make the backbutton work. Html test code <script type=”text/javascript”> $(“#home”).click(function(){ $.mobile.changePage(“home.html”); }); document.addEventListener(“deviceready”, onDeviceReady, false); document.addEventListener(“backbutton”, handleBackButton, false); function onDeviceReady() { console.log(“PhoneGap Ready!”); } function handleBackButton() { console.log(“Back Button Pressed!”); navigator.app.exitApp(); } </script> Put the following code in the else block of … Read more

Issue with Android Hybid app to display remote image with Ionic framework?

Whitelisting the domains using cordova-plugin-whitelist solves the issue. Add the plugin via CLI: cordova plugin add cordova-plugin-whitelist and then add the following line of code to your app’s config.xml: <allow-navigation href=”http://*/*” /> and this meta tag in your index.html <meta http-equiv=”Content-Security-Policy” content=”default-src *; style-src ‘self’ ‘unsafe-inline’; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval'”> EDIT: The reason for this … Read more

Cordova + Angularjs + Device Ready

Manually bootstrap your Angular app: Remove your ng-app attribute from your HTML code, so Angular doesn’t start itself. Add something like this to you JavaScript code: document.addEventListener(“deviceready”, function() { // retrieve the DOM element that had the ng-app attribute var domElement = document.getElementById(…) / document.querySelector(…); angular.bootstrap(domElement, [“angularAppName”]); }, false); Angular documentation for bootstrapping apps.