Cordova splash screen - css

I setup everything in phonegapp application. After i drag and drop the CordovaLib.xcodeproj then change the splash screen inside my app icon & screen folder. But still app loading cordovaLib splash screen. So, i deleted screens from CordovaLib project and it's working. I have splash screen name as Default.png, Default#2x.png etc. But in config.xml file having some other name. But my app working with proper screens. Is i need to change in config.xml file.
<gap:splash gap:platform="ios" height="480" src="res/screen/ios/Default.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="res/screen/ios/Default_at_2x.png" width="640" />
<gap:splash gap:platform="ios" height="1136" src="res/screen/ios/Default-568h_at_2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/Default-Portrait~ipad.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" />
<gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait_at_2x~ipad.png" width="1536" />
<gap:splash gap:platform="ios" height="1536" src="res/screen/ios/Default-Landscape_at_2x~ipad.png" width="2048" />

Yes, your config.xml should always point to the correct location of your splash screens.
Whilst Xcode will ignore config.xml when choosing splash screens, the Cordova CLI does not. Attempting to build and run using the CLI will fail.
In addition, services such as PhoneGap Build will fail to build your app, and even some plugins will cause random errors because of a malformed config.xml, where a path points to a non-existent file.

Related

Phongap build useing splash.9.png as default splashscreen for android

Phone gap build documentation states that:
The default splash must be named splash.png and must reside in the
root of your application folder.
<gap:splash src="splash.png" />
but they also say:
Patch-9 backgrounds are supported. All patch-9 files have to have a
".9.png" suffix.
Does this mean that I can use
<gap:splash src="splash.9.png" />
as the default ?
You are right, according to the documentation, you can't use a 9-patch image as default splash.
Extracts from the Phonegap Build Documentation page:
The default splash must be named splash.png and must reside in the root of your application folder.
and
All patch-9 files have to have a ".9.png" suffix.
I suggest the following solution: Use the same splash.9.png source for all Android sizes and you will have a similar result. One file for all screens.
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="ldpi" />
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xhdpi" />
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xxhdpi" />
<gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xxxhdpi" />
Still, the default splash.png must be present, but will not be used on Android.
<gap:splash src="splash.png" />

custom splashscreen not showing with ionic and phonegap build (3.5.0)

I'm referring to phonegap doc here:
http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html
yet can't have the splashscreen to show after building ( build via phonegap build service, not locally )
relevant ( I suppose ) config.xml lines:
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:splash src="splash.png" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
splash.png is in the root, as is config.xml, is a 480x800 PNG (32-bit color)
I'm building with phonegap 3.5.0 selected; pulling from the git for the ionic project ( so no local 'platforms' dir in the way, since it's in ionic .gitignore.
I also tried the
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi" />
options to no result ('res/screen... dirs also starting from the root where config resides')
I have made no specific splash show/hide code in the app, is this mandatory ? I just want the splash to show for a fixed bunch of seconds...
My advice is twofold:
First, use PGB 3.6.3. Not only is 3.5 outdated, it also has a security flaw in Android that means apps will be removed from the Past Store.
Second (re: your problem). Go back to basics - follow the PGB docs on splash screens in the simplest way possible.
I don't know what the issue, it looks OK to me, but there are a few preferences you have that I don't use and it works fine for me. I'd expand more but I'm on a mobile. I'll check it out in detail later.

loading jar files during splash screen in javafx

I have an application which has refrences to 4 - 5 external jar (lib). But when i run my application on netbeans , netbeans first loads the jar file and after that my application scene appears. And I am trying to use the javafx preloader as well for splash screen. But preloader scene also loads after the jar files loading.
But I want to have loading of jars during my preloader scene is displaying i.e i want the loading of jars as a progress to my splash screen and then my main application scene should start. Pls help
My JNLP file
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="Black.jnlp">
<information>
<title>Black</title>
<vendor>RATTAN</vendor>
<description>Sample JavaFX 2.0 application.</description>
<offline-allowed/>
</information>
<resources os="Windows">
<jfx:javafx-runtime version="2.0+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="Black.jar" size="2407915" download="eager" />
<jar href="lib/commons-codec-1.6.jar" size="253494" download="eager" />
<jar href="lib/commons-io-1.3.2.jar" size="95657" download="eager" />
<jar href="lib/commons-lang-2.0.jar" size="179419" download="eager" />
<jar href="lib/newlink.jar" size="6161" download="eager" />
<jar href="lib/scribe-1.3.0.jar" size="74544" download="eager" />
</resources>
<security>
<all-permissions/>
</security>
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="Black" />
<jfx:javafx-desc width="800" height="600" main-class="test.Test" name="Black" />
<update check="always"/>
</jnlp>
I have used another preloader project which i have configured as preloader to my main project in netbeans
Follow the documentation on Packaging an Application with a Preloader.
Check your generated jnlp file, it should contain values something similar to this:
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="lib/FirstPreloader.jar" size="2801" download="progress" />
<jar href="AnimatedCircles.jar" size="13729" download="always" />
</resources>
<applet-desc width="800" height="600"
main-class="com.javafx.main.NoJavaFXFallback" name="AnimatedCircles" />
<jfx:javafx-desc width="800" height="600"
main-class="animatedcircles.AnimatedCircles" name="AnimatedCircles"
preloader-class="firstpreloader.FirstPreloader"/>
<update check="background"/>
Note some important tags download="progress" on the Preloader jar, preloader-class and update check="background".
There is also a download=lazy value you can set on some dependent jars if you like (see the jnlp spec). Lazy download might not really be needed if you have a preloader, but it is defined as:
This means the resource does not have to be downloaded onto the client system before the application is launched.
Note once update checks are switched on and lazy downloading is being used, it can be pretty difficult to accurately debug your application during development because on execution, the app may use cached versions of code rather the latest version of code. So these kind of switches are best just used for final deployment.
Also read thread the Performance Tips section of the JavaFX deployment guide.

Flex 4.5.1 runtime ReferenceError: Error #1065: Variable ... is not defined

Ok, I need some help on this one. I upgraded from Flash Builder 4 to Flash Builder 4.5 and have switched my project to the 4.5.1 sdk. I use an ant script to build my project, so I modified it to use the appropriate flexTasks.jar, mxmlc, etc...
Now, if I start out with a blank bin-debug folder, then build and run the app everything works fine. However, if I then make a code change and build (without deleting the bin-debug) then run the app I get a runtime error:
ReferenceError: Error #1065: Variable ... is not defined.
at flash.display::MovieClip/nextFrame()
at mx.managers::SystemManager/deferredNextFrame()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:284]
at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2633]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/timerHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\Preloader.as:515]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
Again, if I delete the bin-debug folder and compile again it runs with no problems.
The variable it complains about is always a Class variable that points to an image file used as an icon. The code I use to create the var:
[Embed(source="/assets/icons/close-32x32.png")]
public var closeIcon:Class;
The file exists, and I verified that when it gives that error the file is in the bin-debug/assets/icons folder and the src/assets/icons/ folder.
After the error is thrown, if I hit the continue button in Flash Builder it then throws the same error again on the next Class variable pointing to an image file.
Any ideas? The delete/recompile takes several minutes, so obviously this is driving me mad.
Edit: Ant task that compiles in debug mode:
<target name="compile-debug">
<echo>Compile MXML</echo>
<mxmlc
file="${SRC_DIR}/${MAIN_SOURCE_FILE}"
debug="true"
optimize="false"
output="${DEBUG_DIR}/${APP_ROOT_FILE}"
append="true"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="false"
link-report="MyReport.xml"
maxmemory="2048m"
incremental="true">
<!-- Get default compiler options. -->
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<!-- List of path elements that form the roots of ActionScript class hierarchies. -->
<source-path path-element="${FLEX_HOME}/frameworks"/>
<!-- Include Themes -->
<!-- NOTE: Spark theme required -->
<theme dir="${FLEX_HOME}/frameworks/themes/Spark/">
<include name="spark.css" />
</theme>
<theme dir="${FLEX_HOME}/samples/themes/spark_graphite/">
<include name="spark_graphite.css" />
</theme>
<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="../bundles/{locale}" />
</compiler.library-path>
<!-- uncomment if you have external libs (swc files) -->
<library-path dir="${LIB_DIR}/riaspace/" append="true">
<include name="*.swc" />
</library-path>
<library-path dir="${LIB_DIR}/AlivePDF/" append="true">
<include name="*.swc" />
</library-path>
<library-path dir="${LIB_DIR}/coltware/" append="true">
<include name="*.swc" />
</library-path>
</mxmlc>
</target>
Where FLEX_HOME = < path to flash builder >/sdks/4.5.1
The answer is buried in the middle of Maxim's post that he referenced in a comment above:
--> Try turning off incremental compilation.
I had the same issue here with a simple mimeType='application/octet-stream' embed, and when reading Maxim's text this jumped out because I'd recently changed my custom build tools to use inremental compilation: "Embed sometimes fails during incremental compilation"
The result of this failure is that the .swf contains something like this:
<DefineBinaryData id='1' length='1024' />
which looks like it's empty, instead of this (from the working file):
<DefineBitsLossless2 id='1' encoding='base64'>
(.. in my case, 1024 bytes of base64-encoded data)
</DefineBitsLossless2>
(This solved it for me, so a big thank-you to Maxim. I hope it solves it for you too.)
I had the same problem, so I "Clean"ed the project and then re ran. It worked.
I have Flash Builder 4.7 and am using sdk 4.5.1A.
I was using Flash Player debugger version 15 before Christmas of 2014 and everything was working. I had Firefox set up as the default browser. However, in 2015, Adobe has a new player so I upgraded to version 16 and that's when I got the same problem. After much struggle, I found that the problem had to do with the new version of Firefox Flash player debugger. I had to switch the default browser to Internet Explorer and installed the Internet Explorer Flash player debugger. Prior to debugging, I had to clean and update first. Then everything worked again!

Flash Builder (Flex) ANT build and Debug

I'm trying to use ANT with Flash Builder 4 to compile and debug.
The compiling is the easy part but having trouble to get the debugger to work.
I want to use ANT to Debug SWF file inside Flash Builder, so that breakpoints, console traces and everything works as it should.
My script so far. Builds The *.as to *.swf and moves from bin-debug to deploy folder. How can I start a Flash Builder Debugger for the created SWF?
<target name="Compile level 1">
<antcall target="compile flex file">
<param name="file" value="GameOffice"/>
</antcall>
<antcall target="open player">
<param name="file" value="GameOffice.swf"/>
</antcall>
</target>
<target name="compile flex file">
<mxmlc file="${SRC_DIR}/${file}.as" output="${BUILD_DIR}/${file}.swf"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="true"
incremental="true"
static-link-runtime-shared-libraries="true"
show-actionscript-warnings="true"
failonerror="true"
debug="true"
optimize="false">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${FLEX_HOME}/frameworks" />
<compiler.include-libraries dir="${basedir}/libs" append="true">
<include name="HelloThereLibGames.swc" />
<include name="HelloThereLibStructure.swc" />
<include name="HelloThereLibUtils.swc" />
</compiler.include-libraries>
<metadata description="Hello There Production">
<contributor name="Fredrick Bäcker" />
</metadata>
</mxmlc>
<copy todir="${DEPLOY_DIR}" file="${BUILD_DIR}/${file}.swf"/>
</target>
I did a 1 try one hit on google: http://blogs.4point.com/armaghan.chaudhary/2009/04/remote-debugging-using-flex-builder-ide.html
I do not get why you would want to build with ant inside flashbuilder. Seems like crossing the stream for water?
IMHO automated build scripts belong in CI environments like hudson. I consider it doing myself a favor, letting my development environment handle the fuzz of local builds and debugging.
Anyways, best of luck
Assuming you are working off a local web server, you can simply open the debug socket in Flash Builder by setting your debug launch config to a blank html page (eg. about:blank) and then opening your browser to your localhost (or whatever url you've set up).
In this case you would run the build with ant, hit debug to open the socket, then switch over to your web browser and load localhost.
I realise this answer is probably a little late, but better late than never!
Is pretty simple really when you know how. I did a blog entry on it a while back that should show you how:
http://blog.tiltdigital.com/flex/running-flash-builder-4-in-debug-mode-from-apache-ant/
Basically you just need to add an Ant Builder to Flash Builder 'Builders' properties in your project properties. You can then use that to compile/debug using your build script as you'd normally do using the Flash Builder Compiler/Debugger.

Resources