What else is new in Cordova Android 2.4.0

Normally, Simon Macdonald, who also works on Apache Cordova, writes a blog post listing the new features that landed. However, there’s a feature that should be added to that post that I’ll explain below.

Additional Preferences in config.xml:

Certain features, such as the splashscreen, the error URL and timeouts in the past were undocumented, and would have to be added to the activity at the beginning of the class before we load the URL in the Java file, like this:

super.setIntegerProperty("splashscreen", R.drawable.splash);

Since the whole point of Cordova is so that you don’t have to write Java, and to promote web standards, we added these preferences to the config.xml, which should look like this:

<preference name="splashscreen" value="splash" />

The new project settings in config.xml can be found here.

9 thoughts on “What else is new in Cordova Android 2.4.0

  1. Hey Joe. I wanted to do a blog post on these new settings as they are things I’ve not seen before. For example, the loadingPageDialog. I’m building up a small example. loadingDialog works great. loadingPageDialog does not. I assume that if index.html has a link to page2.html, that should force it to show the message, right?

    Also, is the syntax for these guys *really* title,(space)message? Ie, is the space required?

  2. Final question. I promise. :)

    So, I tried using splashscreen. I copied a png to platforms/android/res/drawable. It simply didn’t load.

    Also – why would you use this setting when there is also gap:splash?

    • gap:splash is not supported in Cordova, and only works on PhoneGap Build. It also doesn’t correspond to the W3C spec. These are Android -specific features that do their best to conform to the widget spec.

    • Currently you still need to edit the activity to add a delay to the initial load; (i.e. super.loadUrl(Config.getStartUrl(), 5000)). Ideally we want to move away from any Java code being written at all, but there are still issues being processed.

  3. Pingback: PhoneGap 2.4.0 for Windows Phone 8 and Windows Store Applications - Evangelism - Infragistics.com Blog

  4. Pingback: PhoneGap Community Roundup – February 2013 | SDK News

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>