771
Views
9
Comments
Solved
Add Drawable icons to Mobile Application
Question

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



2025-02-22 18-27-01
Alfaro
 
MVP
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

dummy-android-plugin.zip
2017-05-28 10-14-49
Dedy Ariyanto

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.


2022-12-12 12-54-26
Emmanuel Dominguez

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



Hello Carlos, I was following exactly as you mentioned in the previous post but I got this result 



please if someone can give me a clue to the problem


2025-02-22 18-27-01
Alfaro
 
MVP

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

UserImage.jpg
Luciano Guimaraes

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

2024-03-25 06-19-08
Harlin Setiadarma

Love it. 

I was looking around for a long time for this. 

2018-01-05 02-53-30
Grayson Udstrand

Hello Emmanuel,

When I had this problem it is because I was zipping the top-level folder rather than highlighting all the resource files and zipping those. So the zip folder directory was:

res.zip > res > dummy-android-plugin

Instead of just 

res.zip > dummy-android-plugin

2018-07-06 11-13-55
Nathan Hobbs

HI,

I'm getting Error: Invalid resources type in your extensibility configurations. Review it and try again. 

Has something changed?

Kind Regards

Nathan

2018-07-06 11-13-55
Nathan Hobbs

Alfaro,

You need to lose the S from resources:

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

Kind Regards

Nathan Hobbs

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.