Phonegap: config.xml update request

Discussion and feedback on Construct 2

Post » Fri Feb 14, 2014 6:33 am

I've spent the last few days playing around with Phonegap Build. VERY exciting, I can tell you.

However, I think that it's come a long way over the last few months from when I last played with it and it's now quite a viable option for porting simple apps to iOS and android. Although I don't think it will ever compete with Crosswalk for running physics based games (not ever?) it is still pretty good for simple puzzles etc (and it's < 17 Mb, no flickering splash screen, loads in 2 sec...). Anyhow, enough of this: I have some Phonegap export requests to make and I hope Ashley might be able to include them in a future build just to make life a bit easier.

Please could the Phonegap build process add the following lines of code to the config.xml file (commented out if need be, but having it there would save hours of internet searching for the non-coders among us):


To control which Build version to use, add:

<preference name="phonegap-version" value="3.3.0" />

Although the version number included will become legacy I'm sure, by stipulating a build version you can ensure that you have control over which is used. I found that without this the Build sometimes regressed to using 3.1.0 (a couple of others on the forum have had similar problems). No 'biggie', but it was irritating.

To hide the status bar on iOS 7, add:

<!-- Hide Status Bar iOS -->
<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">
     <false/>
</gap:config-file>
<gap:config-file platform="ios" parent="UIStatusBarHidden" overwrite="true">
     <true/>
</gap:config-file>


The above code works a treat, the old "<preference name="fullscreen" value="true" />" no longer works on the latest gift from Apple. From what I understand, build >3.0.0 has this problem but the above code sorts it out.

To manage the splash screen on iOS, add the following:

<!-- Do not auto hide splash on iOS -->
<preference name="AutoHideSplashScreen" value="false" />
<!-- Do not auto hide splash on Android -->
<preference name="SplashScreenDelay" value="10000"/>

<gap:plugin name="org.apache.cordova.splashscreen" />


Some users (including myself) encountered white screens after the splash screen on iOS. The above code allows the splash screen auto-hide to be over-ridden, which ensures that there's not a blank canvas for 1/2 sec or so until the first layout loads.

For android builds, inside the widget at the top of the config.xml add:

<widget ......
     versionCode = "xxxx"
     .......>


Where the versionCode xxxx is the numerical identifier used by android/google for app version identification. Control over this number is important if you're going to have a successful app load onto Google Play and Phonegap will insert the number into the Manifest file during the build. I think omission results in a default 1 and is a pain to fix if you need to upgrade your apk. The details could be added to the popup settings window prior to export.

There's loads more available on the Phonegap website but I thought that these changes would be really helpful and keep C2 up to speed with other non-of-the-moment 3rd party wrappers.

Enough from me, I hope this is supported - thanks!Colludium2014-02-14 06:35:29
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Fri Feb 14, 2014 3:13 pm

My one and only bump, becaue there have been a lot of new topics recently...
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Sat Feb 15, 2014 1:19 am

Woah, this is really really useful, thanks for sharing! Hope ashley can do this on next update.
B
38
S
8
G
3
Posts: 439
Reputation: 6,876

Post » Tue Sep 16, 2014 4:07 pm

You should be able to use the Intel XDK as an alternative to phonegap build. In addition to crosswalk in XDK build tab, you can select ios & android. You will be using standard phonegap/cordova so you will get the small apk. It doesn't read the config.xml, but the project settings in Intel XDK will let you specify full screen, version codes, etc.
Intel Corporation
B
15
S
3
Posts: 193
Reputation: 1,552


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests