PhoneGap Android: How to force Application to use

2019-01-07 20:34发布

问题:

I have created new Android phonegap project using eclipse and put my existing WWW folder of my iphone phonegap project.

I have all the icons and screen added for android device inside Android folder as show here.. and also added it to my config.xml

For HDPI I have following icon and screen.

assets\www\res\icon\android\icon-72-hdpi.png

assets\www\res\screen\android\screen-hdpi-portrait.png

When I run the application in Emulator, it keep showing the default PhoneGap icons and splash screen.

I have added icons and screens for LDIP, MDPI, HDPI, XHDPI.

here is my config.xml

   <icon src="icon.png" />
<icon src="res/icon/android/icon-36-ldpi.png"   gap:platform="android"    gap:density="ldpi" />
<icon src="res/icon/android/icon-48-mdpi.png"   gap:platform="android"    gap:density="mdpi" />
<icon src="res/icon/android/icon-72-hdpi.png"   gap:platform="android"    gap:density="hdpi" />
<icon src="res/icon/android/icon-96-xhdpi.png"  gap:platform="android"    gap:density="xhdpi" />

Is there anything I need to set to use assets\www\res folder instead of the default eclipse EclipseProjectRoot\res\drawable folder ?

Thanks

回答1:

config.xml is used only by the PhoneGap Build service.

- Building locally, this file is ignored and the files in your res/drawable directory are used.
- Building with PGBuild, the service looks for this file at the root of your project (next to index.html) and uses it to identify what images should be copied into the res/drawable folder on their end to generate an apk with the right images (in the case of Android).

Since PGBuild builds for a lot of platforms, config.xml is their way of offering as much customisation capabilites as they can outside of the html/js/css. Some of this is just for picking your icons/splash images for each platform but you can do a lot more with too. PGBuild does each of the natively required actions for each platform based on the contents of the uploaded file.

I hope this is clear enough.