Outdated sample for Cordova

Due to continuing issues with the new splash screen configuration for Android 12 (and 13) I checked if the sample for Cordova (GitHub - voltbuilder/sample: Simple app for VoltBuilder as linked to from volt.build) could help me out.

It’s >2 years old and clearly not adapted to those new versions. It also includes this bug, even though there’s clearly no such image (there’s a 150 one though):

    <icon src="/www/images/voltbuilder-192.png" />

Also, I believe there’s an unnecessary amount of images anyway.

I haven’t tested the sample, as it would be no point now.

Anyway, after a system upgrade an Xiaomi 11T will now show a tiny version of the square 2732x2732 splash in the middle of the screen, so an improvement since before, but not by much :).

See Can't replace default splashscreen for info on letting VoltBuilder generate images.

@anders.borg - thanks for spotting this. We’ll get it updated right away.

The sample has been updated. VoltBuilder now generates the images.

Great :+1:. I’ll go through it to see if I’ve missed something.

Thanks - and let us know if it could be improved.

This would ease understanding:

  • Some logical partitioning and more line breaks.
  • Put things related to a specific platform under each platform block.

Is icon needed anymore? I added one just in case.

I have more platform-specific settings, as I haven’t seen that they are outright outdated. Not saying they are necessary (some are copy-paste).

I include the config.xml from the app I’m working on right now after switching to VoltBuilder generating the images. I did some re-ordering to better follow the template.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<widget
    xmlns="http://www.w3.org/ns/widgets"
    xmlns:gap="http://phonegap.com/ns/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="---"
    version="0.03"
    android-versionCode="003"
    ios-CFBundleVersion="003"
>

    <!-- App information -->
    <name>---</name>
    <description>---</description>
    <author email="---" href="---">---</author>

    <!-- General -->
    <content src="index.html"/>
    <allow-navigation href="*"/>
    <access origin="*"/>
    <allow-intent href="*" />

    <icon src="www/images/icon.png" />

    <preference name="permissions" value="none"/>
    <preference name="orientation" value="portrait"/>
    <preference name="fullscreen" value="false"/>

    <preference name="SplashScreenDelay" value="2000" />
    <preference name="AutoHideSplashScreen" value="true" />

    <preference name="StatusBarOverlaysWebView" value="false"/>
    <preference name="StatusBarBackgroundColor" value="#ffffff"/>
    <preference name="StatusBarStyle" value="default"/>

    <!-- iOS -->
    <platform name="ios">
        <preference name="deployment-target" value="11.0"/>
        <preference name="target-device" value="universal"/>
        <preference name="prerendered-icon" value="false"/>
        <preference name="EnableViewportScale" value="false"/>
        <preference name="detect-data-types" value="true"/>
        <preference name="exit-on-suspend" value="false"/>
        <preference name="AllowInlineMediaPlayback" value="true"/>
        <preference name="DisallowOverscroll" value="true"/>

        <preference name="WKWebViewOnly" value="true" />

        <feature name="CDVWKWebViewEngine">
            <param name="ios-package" value="CDVWKWebViewEngine" />
        </feature>

        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    </platform>

    <!-- Android -->
    <platform name="android">
        <preference name="android-minSdkVersion" value="22"/>
        <preference name="android-targetSdkVersion" value="32"/>
        <preference name="android-compileSdkVersion" value="32" />
        <preference name="android-installLocation" value="auto"/>
        <preference name="AndroidXEnabled" value="true"/>

        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/splashTemplate.png" />
        <preference name="AndroidWindowSplashScreenBackground" value="#ffcd00" />
    </platform>

    <!-- Plugins -->
    <plugin name="cordova-plugin-splashscreen" />
    <plugin name="cordova-plugin-statusbar" />
    <plugin name="cordova-plugin-device" />
    <plugin name="cordova-plugin-ble-central" />

</widget>

Thanks, @anders.borg - some good ideas here. We will update the sample.

Sample has been updated. We’ve added some more typical setup stuff in config.xml.

Great. Thanks.

Even if existing devs might not use it as-is, it’s good to compare with a working example (and not just docs), to see how to update for new things, like the Android 12 splash screen.

It seems the content tag is not necessary. Anyway, I sometimes use it to switch between different UI layouts (in separate .html files) while testing out those aspects. Not needed for a template though.