Add Drawable icons to Mobile Application

Add Drawable icons to Mobile Application

  

Hi,

Is there any way to add images to the /res/drawable-* folders of the generated App package?

All I could find was how to Modify the App Icon, and in the Extensibility Configurations JSON Schema page there is no mention of the possibility of adding extra images, or any other kind of resource, to the App.

Thank you.

CA



Solution

Hello,

I've found a way of adding  images to the /res/drawable-* folders of the generated App package, by using a dummy Cordova Plugin. The images, and possibly other files, are included using the <resource-file /> directives of the plugin.xml file.

An example plugin code is in the zip file attached, in this case it adds the Pushwoosh notification icons as described in the Pushwoosh Android FAQ - How to set a notification icon in Android Lollipop.

These are the steps to use it:

1 - Open the main application module and import the new or the updated zip file to the resources folder:

2- In the Extensibility Configurations value window, create a JSON object to include the dummy plugin:

{
    "plugin": {
        "resource": "/dummy-android-plugin"
    },
    "resources": "dummy-android-plugin.zip"
}


CA

Solution

Carlos Alfaro wrote:

Hello,

I've found a way of adding  images to the /res/drawable-* folders of the generated App package, by using a dummy Cordova Plugin. The images, and possibly other files, are included using the <resource-file /> directives of the plugin.xml file.

An example plugin code is in the zip file attached, in this case it adds the Pushwoosh notification icons as described in the Pushwoosh Android FAQ - How to set a notification icon in Android Lollipop.

These are the steps to use it:

1 - Open the main application module and import the new or the updated zip file to the resources folder:

2- In the Extensibility Configurations value window, create a JSON object to include the dummy plugin:

{
    "plugin": {
        "resource": "/dummy-android-plugin"
    },
    "resources": "dummy-android-plugin.zip";
}


CA

Hi Carlos,

I follow your step and get error when create JSON object. I got error on ' ; ' after .zip"

when i delete ;  the error is gone but icon not change still got default icon (white bell)

What i supposed to do?


Thank you.


Hi Dedy,

Thank you for the correction to the typo in plugin code.

Are you using the mobile Pushwoosh Plugin? You should get by default a white square, not a white bell. 


CA

Hi everyone!

I tried this and it is working using OneSignal Plugin also.

Thank you Carlos for your help! It was amazing! You deserve a Nobel Prize ;-)

Cheers

Luciano Guimaraes

Love it. 

I was looking around for a long time for this.