App icon for Android in Phonegap [duplicate]

给你一囗甜甜゛ 提交于 2019-12-18 17:29:53

问题


I have an HTML5/Javascript app, and I have used PhoneGap's build service to generate the APK file for my Android.

I successfully installed the APK file on my Android and everything is fine, except that the app icon on the phone is the default Android icon. In PhoneGap Build I uploaded my PNG file to the project under the 'Details' section, and I thought that icon was supposed to be used as your app icon? I've tried several different sizes.

Let me know if there is something else I need to be doing.


回答1:


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




回答2:


None of the above answers worked but I figured it out how. Create a png icon and name it "icon.png" and simply place the image under "Project_Folder/res/drawable-hdpi/", where Project_Folder is your PhoneGap application folder.

Hope that helps.



来源:https://stackoverflow.com/questions/8230810/app-icon-for-android-in-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!