Search code examples
visual-studio-cordovamulti-device-hybrid-apps

using nine-patch splashscreens in Multi-Device Hybrid applications


Is there a way to use/define nine-patch splash screens in android platform?

I only managed to do it following the steps bellow:
1. change config.xml from
<preference name="SplashScreen" value="screen" />
to
<preference name="SplashScreen" value="splash" />
2. clean/build or rebuild the project
3. go to folder bld\Debug\platforms\android\res and create a new folder named drawable-nodpi
4. add my splash.9.png file in this folder
5. build/deploy application

Subsequent clean or rebuilds will delete this directory. I can only use build or deploy and every time I need to clean or rebuild, I have to manually create the directory and copy the nine-patch png file.

Also, I don't think that the project honors the SplashScreen value entered in config.xml, as it always copies the files screen-*-*.png from res\screens\android to the build directories and not the [SplashScreen]-*-*.png (where [SplashScreen] is the value of preference named SplashScreen in config.xml and * are the supported resolutions and orientations).

Of course without this "bug" I wouldn't be able to use the above technique and have a nine-patch png for splashscreen in android.


Solution

  • You can place your image in this location and it will be copied there as part of the build: res\native\android\res\drawable-nodpi\splash.9.png