Generating iOS and Android icons in Cordova / PhoneGap

I wrote a script that auto generates icons for cordova using ImageMagick: https://github.com/AlexDisler/cordova-icon To use it, create an “icon.png” file and place it in the root folder of your project, then run: cordova-icon and it will generate all the required icons for the platforms your project has. You can also configure it as a hook … Read more

Cordova InAppBrowser – How to disable URL and Navigation Bar?

To remove the URL, just set the ‘location‘ option to “no“. var ref = cordova.InAppBrowser.open(‘http://apache.org’, ‘_blank’, ‘location=no’); On Android, this removes the ‘Back/Forward’ buttons, URL and ‘Done’ button, not just the URL, but thankfully there’s a special Android-only ‘hideurlbar’ option to remove ONLY the URL. var ref = cordova.InAppBrowser.open(‘http://apache.org’, ‘_blank’, ‘hideurlbar=yes’); The ‘Done’ button text … Read more

Phonegap Plugin:How to convert Base64 String to a PNG image in Android

The solution; This plugin that converts a Base64 PNG String and generates an image to the sdCard. Let’s go! 1. The Base64 Decoder Get this blazing fast Base64 encode/decoder class called MiGBase64. Download it from SourceForge. Create a folder called ‘util’ within your project’s src/ folder. Place the downloaded class there. 2. The java Create … Read more

Cordova, why would InAppBrowser plugin be required to open links in system browser

So I’m answering my own question with what I’ve found out. Note I’m only dealing with iOS and Android (with Crosswalk plugin) on Cordova 5.1.1, and it may not apply to other platforms/versions. InAppBrowser is required Even if you don’t need an embedded browser, InAppBrowser plugin is required. This makes the _system target available that … Read more

How to use Google Analytics with Phonegap without a plugin?

Check out the video to see it in action: http://screencast.com/t/6vkWlZOp After some research, I found a solution. I came across this thread on the Phonegap Google Group: https://groups.google.com/forum/#!msg/phonegap/uqYjTmd4w_E/YD1QPmLSxf4J (thanks TimW and Dan Levine!) In this thread I found that it is possible to use Google Analytics without a plugin. All you have to do is … Read more

Add entry to iOS .plist file via Cordova config.xml

I don’t think you can do this via straight config.xml modification. At least, I didn’t see any mention of this in the docs: http://cordova.apache.org/docs/en/3.3.0/config_ref_index.md.html I think you have to create a plugin, because they can insert plist entries: http://docs.phonegap.com/en/3.3.0/plugin_ref_spec.md.html#Plugin%20Specification See the ‘config-file element’ section. Here’s a guess as to what the relevant section of the … 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