0
votes

I come from Android Programming and now i try to work with Cordova. In android when you want to have an image for a button or any other component you always have to provide different resolutions for different screens. Those are:

  • ldpi
  • mdpi
  • hdpi
  • xhdpi
  • xxhdpi
  • xxxhdpi

Unfortunately i cant find any information about where to place those images in a cordova project and if cordova also automatically loads the needed images for the current screen size / screen density.

3

3 Answers

1
votes

You can specify images for different resolutions for the app icon and splashscreens (see Icons and Splashscreens), but not for every image in your app.

For the images you use in your HTML, you'll have to handle this manually.

1
votes

You can also automate icon creation for both Android and IOS. Cordova-icon will create from master png file all the different size of icons needed.

https://www.npmjs.com/package/cordova-icon

0
votes

I think Cordova automatically use icons in different sizes in OS menus... To achieve what you say, in app icon resize, you need something like JQuery and do it from JS code. Request dimension to the browser and set image src or css as needed.