Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

eclipse - PhoneGap Android: How to force Application to use icons from assetwww es instead resdrawable folder?

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.

assetswww esiconandroidicon-72-hdpi.png

assetswww esscreenandroidscreen-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 assetswww es folder instead of the default eclipse EclipseProjectRoot esdrawable folder ?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...