Skip to content

A cordova hook that copies various resource files, mainly intended for icons and splash screens, into the appropriate platform's specific location.

License

Notifications You must be signed in to change notification settings

numediaweb/resources_copier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

This assums you are using npm, node and cordova-cli.

npm install cordova

Install

Copy resources_copier.js into the .cordova/hooks/before_prepare directory.

Assets directory

Create a config folder on the root of your cordova project. Place your assets (icons & splash screens) in that directory;

.cordova
config
`-- android
    |-- res
    |   |-- drawable
    |       |-- icon.png
    |       `-- splash.png
    |   |-- drawable-hdpi
    |       |-- icon.png
    |       `-- splash.png
    |   |-- drawable-land-hdpi
    |       |-- icon.png
    |       `-- splash.png
    |   |-- ...
platforms
www
...

Test

Type in the CLI cordova prepare android. It copies files into the Android platforms. To debug add -d; cordova prepare android -d

You may have to user sudo chmod -R a+rwx ./.cordova/hooks/before_prepare/resources_copier.js to update permissions to run the hook.

Usage and platform notes

Android splash screen

In order to take advantage of the splash screen in Android, add this two linees to the config.xml in your www folder

<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="3000" />

Notes

As of cordova 3.3 and Android splash screen support; cordova assums you put landscape screens in folders where you append land to the name, like; drawable-land-xhdpi

About

A cordova hook that copies various resource files, mainly intended for icons and splash screens, into the appropriate platform's specific location.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published