All right, it may change in the future but currently, setting up icons and splashscreens for your apps is not (totally) done in the plugin’s admin panel. You’ll have to do 3 things:

  • Prepare assets
  • Reference assets in the config.xml file (using WordPress)
  • Download the project ZIP and add assets to it
In this article, I assume that you use PhoneGap Build to build your apps. More generally, we give preference to that way of building apps as it is a lot more easier for beginners. It doesn”t mean that you can’t use the CLI method to build WP-AppKit projects if you want to. But be aware that regarding icons and splashscreens, there are differences between the two: http://docs.phonegap.com/en/3.5.0/config_ref_images.md.html.

Preparing Assets

First thing to do is to create all the needed assets. The difficulty comes from the different screen densities support. Basically you’ll have to do one asset per density, per OS for icons and splashscreens.

Android and iOS handle things differently. Android defines density ranges and iOS has fewer variations (retina/non retina and iPhone 4/iPhone 5).

WP-AppKit Icons Example

WP-AppKit icons for Android

A thing that you may want to do is to create a special kind of PNG for Android called 9-patch images. Those images have the capacity to extend in order to support different screen dimensions. More info here: http://developer.android.com/tools/help/draw9patch.html.

Referencing Assets

In the WordPress edit panel of your application, search for the PhoneGap Plugins text area. This is where you’ll add the XML tags that reference the app’s icons and splashscreens.

Referencing icons and splashscreens for PhoneGap Build is explained here.

Here what we use for our demo apps.

 

 Adding Assets To The Project

When you’ve finished creating assets (i.e. PNG files), you’ll have to add them manually to your project’s archive (i.e. ZIP file). It means that once you have downloaded the ZIP file of your project from the edit panel in WordPress, open it and add the icon and splashscreen images to it before submiting the archive to the PhoneGap Build.

At this step, errors come often from the fact that you have stored the assets in a place which is different from what you have declared in the config.xml. Make sure that the two match. In the examples above, assets are stored in an icons and a splashscreens subfolders (except for the Android default icon and splashscreens).

Here how we store icons and splashscreens for our demo apps.

Demo App Project

Wp-AppKit demo app icon and splashscreen folders

Happy coding!

Published by Benjamin on July 18, 2014

Head of Digital for a press group, WordPress since 2008, WordCamp organizer, developer for the fun

Leave a Reply

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

Having questions?

FAQ | Tutorials | Documentation

Or

Contact Us