sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
07/28/14 07:10 PM (9 years ago)

Offline use - what impact when the phone can't get the config file?

What happens if a user launches a buzztouch app where there's no data, or maybe they don't have a data plan and rely on wifi. * Will there be a copy of config embedded in the app that gets replaced if the user is online? * If a menu links to an external file (as in the json plugin video) will there be a embedded copy at compile time that gets replaced? or does the app need a way to degrade gracefully?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/28/14 08:10 PM (9 years ago)
I often create apps that are designed to work offline... With consideration to a 'Live' mode config, the whole shebang works sorta like this: 1) On initial startup, the BT_Config.txt file is copied to cache, and read into the app. 2) During processing, in the 'phone home' part of the app initialization, if the app can 'reach' home, it will query to see if a newer version of the config is available. 2A) If a newer config is available and 'reachable', then the app downloads the latest version of the config from your BT Control Panel, copies into the 'Cache' and continues processing. 2B) If a newer config does not exist, or is not reachable, the app continues to use the existing BT_Config.txt that it copied into your cache. 3) If you ever make changes to an app that is in 'Live' mode (and they should all be in live mode, if possible) then 'until you publish' your changes, the "live config" will not be updated, and the device will not know a newer configuration is available. The reason for this is so you can still have a 'debug' mode config in your test unit, and 'any' change in the control panel will be reflected in a 'debug' mode config file, and you as the developer can view and decide whether the new config is what you want. If it is, you 'publish' in the control panel, and a new config is available the next time the user starts the app. If an app is 'offline', either by design or circumstance, the 'latest config that was copied into the cache' will be the config used. If the user clears the app cache from a utility or via settings, then the app will react as if new; the cycle starts over again. Best Practices would be to include the latest 'Live' mode confiuration just before you compile your app for public distribution. Hope it's not too long winded, and makes sense. Cheers! -- Smug
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
07/28/14 08:23 PM (9 years ago)
Thanks - great explanation.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/29/14 12:43 AM (9 years ago)
Excellent explanation, Smug! Just as a point of clarification, and to directly answer one of your questions...your app will be compiled with a copy of the BT_Config.txt file included. That's the config file that Smug talks about above, and which gets copied into cache. I just wanted to make sure you were clear that it ships with the app. That way there is at least an initial version of the config file for the app to parse and "build" the display for the user. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
07/29/14 02:23 AM (9 years ago)
Anyway to replicate that for other data - I'm playing with a basic copy of the monterey harbour app but I have a database of addresses to display which I'm pulling from one of my sites. It would be great to have that cached - more as a learning exercise than really needing it (in this instance). my bedtime reading - checking out BT_filehandler
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.