So, the bottom line is that if I'm going to have multiple files, each one should have only one screen in it.
Yes. IMO, the multiple-page feature is a misfeature, and probably the most mis-used feature of jQuery Mobile.
There are only a very few good uses for it:
- A micro-site with no more than a handful of pages, and that will never get bigger
- A section of a larger site that doesn't use jQuery Mobile. Essentially, a micro-site within a larger site
- A mobile app that is similar to a micro-site. Might have hundreds of pages, but only a handful of page templates, which are populated dynamically
I was thinking that it would be nice to have just a few multi-page files so there would be fewer requests of the serve
Yes, that's a nice advantage, but more than negated by the disadvantages. There are other ways of delivering pages efficiently, though they do all necessarily involve multiple requests, which is an issue in mobile due to latency
What about performance in phonegap apps? Am I
better off having a large, single HTML file with all the screens in it
or individual files, one for each screen?
There's almost no latency when loading a page. There's no need for multi-page documents.
I do use both
data-dom-cache and occasionally
data-prefetch in native apps (PhoneGap and Rhodes). I almost always use iScroll, and so with data-dom-cache, users can return back to a page and not lose their place.
Those two will cover most any case where you might be tempted to use a multi-page document.
From the user's standpoint, using
data-prefetch is superior to a multi-page document. They get the page they want to see initially more quickly, and then other pages will typically already be delivered by the time the user decides to tap on a link.
A multi-page document might be better for your server. But, are you designing your app for your users, or to minimize server load? If you are delivering pages that the user might or might not ever read, you've already answered the question. You are at least trying to design for the user. So, go all the way and really design for the user, not to minimize server load.