Best practise for developing for round and square watches

It is still the best way to create a resources sub folder for each watch type and have a separate xml file contain the name of the watch and query that then do the layout depending on it?


I dont like the layout.xml way, it just is more fiddly it seems.

Thanks!

Are there any tips for the different sizes of say the 235 and Fenix?
  • It is still the best way to create a resources sub folder for each watch type and have a separate xml file contain the name of the watch and query that then do the layout depending on it?


    I dont like the layout.xml way, it just is more fiddly it seems.

    Thanks!

    Are there any tips for the different sizes of say the 235 and Fenix?


    in the 1.2.x SDK there are new device settings for things like partNumber (this will tell you the actual device), screenShape (SCREEN_SHAPE_ROUND, SCREEN_SHAPE_SEMI_ROUND,SCREEN_SHAPE_RECTANGLE), isTouchScreen, etc. If you're running on a 1.2.x VM you can use those.
  • I'm also interested in this. I have started developing using the obscurity flags and get screen size etc. One tip would be - try not to hard code pixel offsets. For example use fractions of screen dimensions

    here's a snippet from my 235 code - yes I contradicted myself with the x_offset :) It should be var x_offset = 0.07 * dc.getWidth();

    I will try running it as Fenix and see if it works.

    I'm sure some of the more experienced developers have some better methods and tips!

    [PHP] if (obscurityFlags == (OBSCURE_LEFT | OBSCURE_RIGHT | OBSCURE_TOP | OBSCURE_BOTTOM)) {
    // Single field
    var x_offset = 14;
    max_barwidth = dc.getWidth() - (x_offset * 2);
    maxY = dc.getHeight();
    // bargraph attributes
    barHeight = (0.5 * maxY).toLong();
    tick_height = barHeight / 2;
    // starting bargraph coordinates
    x_axis = x_offset;
    y_axis = (maxY/2 - (barHeight / 2)).toLong();
    zonelabel_y = 4;
    }[/PHP]
  • Former Member
    Former Member over 9 years ago
    Centre justify your labels

    As well as using the getwidth approach and using proportions of the screen size to position things, I centre justified my labels. You can specify them in the resource file as justified either vertically or horizontally, but not easily both, or at least I failed. However doing something like

    var viewlabel= View.findDrawableById("MyLabel");
    // Centre vertically (4) and horizontally (1) using a hack
    viewlabel.setJustification(5);

    You can then get better control of where things go. Somewhere Garmin have documented how big the fonts are too, which helps further.

    R.
  • docs say

    Get the part number for this product as a string

    Short of trying the call for each watch type in the simulator, is there a list of EXACTLY what it returned? Is there a list somewhere in the docs? Cannot find it. Ta.
  • docs say

    Get the part number for this product as a string

    Short of trying the call for each watch type in the simulator, is there a list of EXACTLY what it returned? Is there a list somewhere in the docs? Cannot find it. Ta.


    You can figure out the part numbers fairly easily from looking at the devices.xml file in the bin directory of the SDK.

    For example:


    <device id="fr630" part_number="006-B2156-00" name="Forerunner® 630">
  • You can specify them in the resource file as justified either vertically or horizontally, but not easily both, or at least I failed.

    You can combine justification flags in the resource file. Here is a snip from one of mine...

    <label id="Name" x="102" y="74" color="Gfx.COLOR_WHITE" font="Gfx.FONT_LARGE" justification="Gfx.TEXT_JUSTIFY_CENTER | Gfx.TEXT_JUSTIFY_VCENTER" />


    Travis
  • Odd that there is a get part number call but not a get device id call. Ho hum. Go figure! So we can SAFELY use the part number from the devices as gospel "as is"?
  • Odd that there is a get part number call but not a get device id call. Ho hum. Go figure! So we can SAFELY use the part number from the devices as gospel "as is"?


    I suspect so... That's why it's exposed in the SDK.