settings.xml in device depending sub folders

Hello community,

I'm going mad with these resource folders.
How is it possible to create different settings.xml depending on device (screenshape)?
I have the following resource folders: "resource", "resource-round" and "resource-semiround".
In the device-dependent folders are drawables, which work properly depending on the screenshape.
If I add per device a settings.xml, this is ignored.
In "only resource", is no settings.xml. I have the impression, it is always the settings.xml used, which is located in the folder structure above (in eclipse). Can this be?
How else is it possible to create different settings depending on screenshape?
Here i add a screenshot of my folders:
  • Not sure if this will fix your problem, but I always nest the more specific resources in the outer resources folder as shown below. Looks like you have resources and resources-round at the same level.

    resources
    -->drawables
    -->layout
    -->resources-epix
    ...
    -->resources-round
    ....
  • I'm going mad with these resource folders.

    Are you running into the problem described in this post?

    Looks like you have resources and resources-round at the same level.

    This is how it should be. Have a look at the directory hierarchy used by the sample programs with resource overrides.

    C:\Development\Garmin\connectiq-sdk-win-2.2.3\samples\Drawable>tree /a /f
    Folder PATH listing
    Volume serial number is 000000BD F228:56FE
    C:.
    | .project
    | manifest.xml
    |
    +---resources
    | | bitmaps.xml
    | | strings.xml
    | |
    | \---images
    | cloud.png
    | icon.png
    |
    +---resources-edge820
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-edge_520
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-rectangle-148x205
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-rectangle-205x148
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-rectangle-240x400
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-round
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-round-240x240
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    +---resources-semiround
    | \---drawables
    | backdrop.xml
    | train.xml
    |
    \---source
    DrawableApp.mc
    DrawableView.mc


    Travis
  • Hi together,

    thanks for your answers.
    @Travis
    I think, this is exactly my problem :-(
    I have test your propertys-App and the behavior is like you have described. In this test app, the deleting of the cache folder work und you can switch between the devices.
    But in my case the deleting of the cache folder will not work, but i am pretty sure that is the same error.
    The simulator load each time the settings.xml from any folder..? :-(
    Now i need to trust the compiler, that in real it works fine?
    I have changed my folder structure like in your property app but no diffentce in the behavior. I´m very sure, that my files are correct.:

    +---resources
    | +---resources
    | | +---drawables
    | | | drawables.xml
    | | | launcher_icon.png
    | | |
    | | +---fonts
    | | | some fonts.....
    | | |
    | | +---settings
    | | | properties.xml
    | | |
    | | \---strings
    | | strings.xml
    | |
    | +---resources-round-218x218
    | | +---drawables
    | | | lowerDisplay.xml
    | | | upperDisplay.xml
    | | |
    | | +---layouts
    | | | layout.xml
    | | |
    | | \---settings
    | | settings.xml
    | |
    | +---resources-round-240x240
    | | +---drawables
    | | | lowerDisplay.xml
    | | | upperDisplay.xml
    | | |
    | | +---layouts
    | | | layout.xml
    | | |
    | | \---settings
    | | settings.xml
    | |
    | \---resources-semiround
    | +---drawables
    | | lowerDisplay.xml
    | | upperDisplay.xml
    | |
    | +---layouts
    | | layout.xml
    | |
    | \---settings
    | settings.xml
    |
    \
  • Well, the bug has been filed against the simulator for the problem I pointed out. Until they've made a fix, I think you can expect that it won't work properly in the simulator. In previous testing I've verified that per-device settings work fine. I haven't verified this recently, but I do know that it has worked in the recent past.

    Travis
  • If you define one resource string variable per override folder, but nonetheless have a bunch of override folders, theoretically the downloaded program should only show one string used memory-wise, right?

    I'm asking because these override folders seem like they might be a way to incorporate data specific to watch-type, without incurring a hefty memory usage toll (as compared to a large gui/updateDC function which perhaps calculates different UX values per watch-type)
  • Yes. The compiler generates a binary that only contains the resources for the device that it is currently compiling for. When you package an app, the compiler is invoked once for each device that is supported, and packages those binaries into the generated application archive (the iq file).

    You can use build exclusions to include source code that is specific to various devices if you need to. You probably don't have to calculate position of UI elements as much if you use this feature. Of course you can use layouts to solve this same problem, but they seem to take a lot of memory...

    Travis