Phonegap Android: How to Force Application to Use Icons from Asset\Www\Res Instead Res\Drawable Folder

PhoneGap Android: How to force Application to use icons from asset\www\res instead res\drawable folder?

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.

How to add custom app icon on Android in Phonegap?

You can use the PhoneGap Builder for easily describing the app icon in the config.xml.

But if you don't want to use the builder this threads perhaps can help you:

App icon for Android in Phonegap

Icon for app using Phonegap for android

App icon for Android in Phonegap

In the Phone Gap the following should contain

www_android\res\values\strings.xml - contains the name of the app

www_android\res\drawable-hdpi - contains a 57x57 pixel icon

www_android\res\drawable-hdpi - contains a 57x57 pixel icon

www_android\res\drawable-hdpi - contains a 57x57 pixel icon

Source (Step 12)

Alternatively

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.nitobi.johngarrett" version="1.0">
<name>John Garrett Drinking Game</name>
<description>
If you're watching a Canucks game, you need play this.
</description>
<author href="http://www.nitobi.com" email="support@nitobi.com">
Tim Kim, Ryan Betts, Fil Maj
</author>
<icon src="img/beer_72.png" width="72" height="72" />
<icon src="img/beer_48.png" width="48" height="48" />
<icon src="img/beer_36.png" width="36" height="36" />
</widget>

Source

Icon for app using Phonegap for android

You provide your Icon in the drawable Resource Folder in .png format and set it in the AndroidManifest.xml, Application Tab.

Icon: @drawable/name_of_your_icon

directly in the graphical editor, no code required.

Phonegap - How to change default icon?

Well, actually I resolved this problem putting drawable folder with icons & splash screens directly into platform/android/res. And it works.



Related Topics



Leave a reply



Submit