This assums you are using npm, node and cordova-cli.
npm install cordova
Copy resources_copier.js
into the .cordova/hooks/before_prepare
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
...
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.
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" />
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