Discussion Forums  >  WebViews and HTML for Mobile

Replies: 13    Views: 137

JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
05/22/12 08:13 AM (13 years ago)

My custom HTML screens won't allow caching?

Hi everyone, I'm using v 2.0 to build a very simple content-based app. I'm not self-hosted, if this makes a difference to any answer. The html I'm using (created in BT html editor) displays fine on both the emulator and the iPhone I'm using. I have a problem with the 'force refresh' function, however. I've tried to save the 'No, allow caching' function but it simply will not save as this! Every time I re-open the screen behaviour drop box, it has reverted to 'Yes, force refresh' option. Is anyone else having this problem or am I doing something incorrect? Any advice on how to make sure that my screens can be set to 'No, allow caching' (and stay on that setting!) would be much appreciated.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 09:07 AM (13 years ago)
Try using Custom HTML doc via URL Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 09:11 AM (13 years ago)
Hi @Jimmy, I don't think it matters in this case. The Custom HTML/Text screen always reaches out to the buzztouch server to retrieve the content for that screen, so it should always be grabbing the latest version of the screen. You can see this by looking in your BT_Config.txt file and noticing that all the content for these screens comes from a buzztouch URL. So...I think you should be good! Mark
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
05/22/12 09:34 AM (13 years ago)
Hi Fred, thanks for the comment. I believe I am using the Custom HTML / Text screen (the one with in-built html editor). If this is the one you're referring to then I believe that there is no load from url function (though I could be wrong). The load from URL function exists on the 'HTML doc' screen but I've tried this too. From the HTML Doc screen, the page does load but the same problem of not being able to allow caching exists. Mark, thanks also for your comment. Whilst I understand that it is pulling the latest content from the 'Custom HTML/Text' screen, surely, in order for the app to work offline, you should be able to cache the html? (Also, if this were not the case, why would there be an option to allow caching in the document behaviour?). Secondly, when I'm using the app on the provisioned iPhone offline, the screen will not load at all. Giving the message that "data for this screen has not been downloaded". So, I'm still in the same situation. Without the ability to cache the Custom HTM/Text screen, my app would not function offline. To surmise, I've tried to 'allow caching' on both the custom html/text screen and the html doc screen with no success (the choice is simply not remembered by either screen). Any other ideas??!! Regards (and thanks) Stephen.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 09:42 AM (13 years ago)
Yes, I meant the HTML doc screen. It should cache. Try the Custom URL, webpage screen. Fred
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
05/22/12 09:58 AM (13 years ago)
Hi Fred, Thanks again for the quick reply! This seems to work (the app is working on the provisioned device and has cached the page in question). Strangely, the document behaviour box still shows the 'yes, force refresh' option even though the 'no, allow caching' was selected and saved. I think my next question will revolve around a similar issue, but that's for later! Regards, Stephen.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 10:07 AM (13 years ago)
Hi Stephen, I verified with @David (creator of BT) that v1.4 does not provide for caching because it's not based on the config file approach that v1.5 and v2.0 is. So, it will always require a network connection for content retrieval, and will not allow for caching. Not sure about why the setting of the options is not working for you, though. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 10:36 AM (13 years ago)
Mark, I'm just starting to wrap my head around this, but I think it's about what you're asking the device to do and not about the Buzztouch version. In this case a HTML doc screen does not cache because nothing is telling it to cache. (This is my understanding.) Whereas in the Custom URL Webpage screen the device by default will cache a webpage. The HTML doc is not a webpage. (Aside: There is no such thing as a Custom HTML text screen. Really, there isn't, read the Buzztouch v1.5 documentation, and you'll see it's true. ) So, we're only talking about two types of screens. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 10:42 AM (13 years ago)
Well, the fundamental question here seemed to be whether v1.4 screens will cache or not, and the answer is they won't. Every resource in a v1.4 app requires a network connection to retrieve...all the time. That's not the case in v1.5/2.0, where more stuff gets cached as a result of using the BT_Config.txt file. There are certainly small differences in the screens and such, and I don't pretend to know them all! But, v1.4 is certainly all online. Mark
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
05/22/12 10:46 AM (13 years ago)
Hi Fred, Hi Mark. I think I may be more confused than ever! Mark, I'll keep trying with this (the issue of a v2.0 custom html page not caching has been posted in the forum before, but it was ages ago and wasn't resolved, as far as I can see). Fred, in the v 2.0 there is a drop down box ('document behaviour') that has the option to select whether the html is cached or not. This option is available for both the custom html/text screen and the html doc screen. My feeling is that it may be a problem with MY html. Im going to tear apart what I've created in the BT html editor and use DW (or similar). Then save each page a html doc and use the URL function in html doc screen. Then I'll see what happens!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 10:48 AM (13 years ago)
This thread is not about BTv1.4. The BT_config.txt file merely will cache the Config data, not a website visited by the user via a Custom URL webpage screen. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 10:53 AM (13 years ago)
Ha! Good point! Got myself confused with a different thread...thought by the same person. I'll have to pay better attention next time! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 10:54 AM (13 years ago)
Has anyone ever cached a HTML doc in Buzztouch using the HTML doc screen? I'm guessing but I'm sure the answer is no. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/22/12 10:59 AM (13 years ago)
@JimmySaver, I accept there's the option, but unless there's code behind the option selecting the option is meaningless. Not all Advance Options apply to each screen. Fred
 

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.