Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 12    Views: 102

CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
08/12/12 05:46 PM (13 years ago)

Question regarding how App refresh works...

Hi, If my app is online and I have selected to not 'force refresh' when navigates to this page, what will happen exactly? Will the page simply load the cached version? or will it load a new page if it is has internet connection? Basically, I wish for user's to see updates I make through control panel, but I also want a page to load the cached version if they do not have internet access. Is this possible? Thanks :) Ben.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
08/12/12 08:33 PM (13 years ago)
Which screen, which Buzztouch version? Fred
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/12/12 08:40 PM (13 years ago)
Buzztouch V2.0 For Screens: Custom HTML (Would only be changing text) Location Map (Wondering if Cached functionality showing Pins would work for offline user) Thanks! Ben.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/12/12 09:11 PM (13 years ago)
Hi @CodeMeNot, If the content of the screen is linked to a URL, then it will refresh automatically regardless of whether you have selected it to force refresh or not. For URL resources, it always refreshes. In all cases, if the resource is online, and it has been accessed at least once (meaning it has been cached), and the user tries to access that resource again, but there is no network connection, it should use the cached version. Hope this helps! Mark
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/12/12 10:35 PM (13 years ago)
Perfect. Thanks Mark! That works great for my HTML pages :) Just out of curiosity if I had selected "Force Refresh" and the user was offline does this mean the page would not be displayed? or the cached version still? Additionally, 'Location map' is linked to a URL so this follows the same rules? Sorry if you have already answer these questions just getting my head around the online app's is confusing for me! Thanks Mark :) Ben.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/12/12 10:42 PM (13 years ago)
Hi Ben, No problem on the questions...we all learn from them! For any resource that is referenced via a URL, the Force Refresh option is essentially disabled. So, it won't matter what you choose, it'll always cache the resource when it's requested, and present the cached version (if previously requested) should the user be offline. If there is a cached version, and the user cannot access the latest version, it should present the cached one, regardless of any refresh options you choose. As for maps, I have to admit I'm not entirely sure. If the user has previously tapped on a map pin, and it requested that resource via a URL, then I suspect it should be cached. But to be honest, I've not tested it, so I can't say for certain. I wrote a doc that deals with online vs. offline...might help things a bit if you have any other questions. http://www.buzztouch.com/files/howtos/Understanding_App_Refresh_and_Offline_Apps_v1.0.pdf If you're still confused on any point, post back. This is by far one of the more complex topics around here. Mark
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/12/12 10:51 PM (13 years ago)
Thanks Mark! (Once again). I had a read of that document previously, was a great help. I think I get my head around it now. Your writing style is great and makes it easy to understand! This just made me think of one final question (I promise). What is the difference between uploading an image to buzztouch.com (for your app through control panel) and putting the image in your local BT_images folder in xCode? Are both required? I have always done both when building the app but I am wondering now that it may only be required in the BT_images folder, in turn making that image offline..? (providing the image name is referenced through CT on buzztouch.com correctly) Thanks again! Ben.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/12/12 11:11 PM (13 years ago)
Hi Ben, Any resource you upload to the buzztouch.com server via the file manager either has to be referenced via a URL, or downloaded and put into your BT_Images or BT_Docs folder, which basically means it's a local resource, and will always be available in offline mode. For any screen, you either need to reference the resource via a URL (can be anywhere as long as it's publicly accessible), or via a filename and have it packaged with the app. Just because it's packaged doesn't mean it's offline, but it does mean no caching is involved, because the resource is always there. The recommendation is basically that if you have resources that won't change often, like certain images, it's best to include them with the app, so they don't have to be downloaded later. But, if you believe the user will always have (or be required to have) network access, then you can certainly offer the resources online via a URL. It's really what works best for the information you are trying to present. Offline vs. online is more a designation related to where the configuration data comes from. If you turn off the Report to URL and Configuration Data URL, then it's an offline app because it can only use the configuration file it was shipped with. Leaving the Configuration Data URL (no matter where it points) leaves the app online, and you can easily refresh it for the user. Here's a forum post I did that might help a bit with that: http://www.buzztouch.com/forum/thread.php?tid=CA595CCBE4EAD2F86FDA682 Hope this helps a bit. Keep the questions coming! Mark
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/12/12 11:31 PM (13 years ago)
Hi Mark, Thanks again for that info. Clears it up. Just had a read of that forum you linked and was wondering with the custom HTML pages does, If I was to include the HTML code within the config file with the correct JSON coding, would this therefore take those pages offline? (providing I remove the Data URL link in CT). Once again... Thank you! I find this stuff really interesting and find I am slowly getting my head around it :)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/12/12 11:42 PM (13 years ago)
Hi Ben, This stuff is indeed quite interesting! David and his crew have done an amazing job of creating buzztouch! I don't think you could take the Custom HTML/Text screen offline by adding the JSON code to the configuration file. The thing about JSON is that it needs, in this case, an Objective C or Java file to process the data and figure out what to do with it. Currently, nothing in buzztouch supports adding HTML to a JSON file. It simply wouldn't work. Plus, it kinda defeats the purpose of the Custom HTML/Text screen, which is to provide an online editor for an HTML page that can easily be changed! Mark
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/12/12 11:48 PM (13 years ago)
Hi Mark, Noted. All in all it makes sense to leave my app online as updates will occur often but randomly and are important. The only reason I wanted an offline version is because its a travel app and wanted people to be able to access it anywhere, but in turn they can just cache the page when they do have internet and access it later. Its a catch 22 really, but in today's world internet is never far off, even in remote countries :) Thanks again mark!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/12/12 11:55 PM (13 years ago)
Sounds like a good plan! Just remember that the person has to have had tapped on the resource at least once in order to cache it...it doesn't happen automatically when the app is opened, for all resources in the app. So, if they don't have network access, and they try to access a resource they haven't accessed before...they'll be out of luck. And make sure you test, test, and test some more! Tap a few resources so they get downloaded once, then put the device into airplane mode and request the same resources to make sure things work as intended. Have fun! Mark
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
08/13/12 12:00 AM (13 years ago)
Yep, thought that was the case :) Still doing the build phase. I work in IT consulting so I am use to the SDLC on a large scale but interesting to implement on a small personal scale! Will definitely test like crazy! I actually currently working in a test team myself, but don't think I will go to the extreme of a test scripts haha. I think I will just mention that is an online app in the product description (providing its makes the app store) and then if I get a question regarding offline access I can provide the further information then :) Thanks for all your help Mark! :)
 

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.