Can I exclude part of the code from the "foreground" app?

When I annotate a class/method with (:background) then it is available in the background app. So basically only the :background annotated code goes to the background app. But much of this code is not really needed in the foreground app. Is there a way to exclude some of it from the foreground app?

  • Not possible.

    The way a .prg is built:

    first there is a header that provides info about the app itself.

    Then, there is the code with the (:background) annotation and I think resources scoped for the background.

    Then there is the code with the (:glance) annotation, amd again, I think resources scoped for glance

    Then everything else

    When the background runs, only the header and (:background) code is loaded

    when a glance runs, the header, (:background) and (:glance) code is loaded

    for the full app, everything is loaded, so it's the same with glance code, where you may not be needed when the full app runs, but it's there.

    I know in my case, the background code is minimal, and so is the glance code.

  • How did you gain the knowledge about the prg structure?  I don't recall seeing that in docs.  I suppose I could try to dissect it myself, but would love to learn more.

  • 1. there are things in the docs

    2. there are things that are not in the docs but "everyone" knows

    3. there are things that only Garmin employees know

    4. there are things that only and know...

  • I first heard about it from the Garmin CIQ folks at one of the in-person summits, and if you go back in the discussion forum from a few years back, you see posts about it. 

  • There are things you pick up after 8 years of doing CIQ that newbies don't even know that they don't know!  Slight smile

  • I'm not programmer by trade, but a fairly experienced *hobby* programmer and I've definitely had alot of questions and ran into alot of issues which could have been avoided if there was more fleshed out doco. 


    Whilst I understand it's a pain in the ass to write initially (I write it in my day job), surely alot of this is info is now 'static' enough that it can be written once and updated on the odd occasion. This 'assumed' but undocumented knowledge really does make it difficult and heaps the burden on the usual suspects in the garmin forums.

    Referencing the samples is also all well and good, but the comments etc could definitely be better to help noobs through. 

    Just my 2 cents from a Monkey C beginner.

  • I also understand that some queries are edge-cases from the 1%'ers on occasion so hitting that balance may be difficult. 

    Things like how to implement multiple layouts in XML, tips and tricks on identifying different devices (ie instinct 2) should absolutely be in the main doco would of saved me HOURS of raking through the forums.