A few notes on developing web apps specifically for phones and tablets. My goal is to create a toolkit that makes it easier to build a web application with a small UI that can scale from phones to tablets to desktop browsers, and gracefully handle orientation changes.
Layout will be different in landscape and portrait modes.
You might want to pack more stuff on tablet pages than phone pages, for example.
The dektop version could simulate a tablet or phone layout by placing the controls inside a pre-sized rectangle in landscape orientation, centering the rectangle on page.
Safari on iOS seems most reliable at handling orientation changes.
WebSession.BrowserType and WebSession.PlatformType need constants for Windows Phone and Tablet. However, IE on these devices doesn’t seem to have orientation events/properties yet.
Knowing the orientation, and not just deducing it from the width/height, is important on Android because in both Chrome and Firefox, the page is resized when the onscreen keyboard is displayed. You can be holding the device in portrat mode (width < height), tap in an edit field, keyboard shows, then you get a resize that shows width > height even though you are still in portrait mode. If you’re wholesale rearranging controls from portrait to landscape, the edit field might jump elsewhere while you’re typing. So it’s imperative to know what the device thinks its orientation is.
Occasionally, your requests to move controls get lost in a reply that the browser bails on or loses, typically leaving your controls laid out for the wrong orientation. You might think using a tap in the main window to arrange controls would help. It won’t, because on the server side, they positions and sizes are correct, as you set them. Not so on the client side.
As I understand it, the last two issues should go away when we get WebSockets, as a single bi-directional channel is kept alive and commands are necessarily serialized, so everything on both sides happens in order.
There are some great possibilities for apps in this space, targeted rather than just tolerant of mobile devices. Xojo is fairly serviceable for creating such apps that run well on what most people have. But there are definitely some issues to watch for.