Moving on from desktop apps

I have only ever worked on Xojo desktop projects, primarily for Mac use, but am now thinking about a fairly simple game project that could be played over the internet by people with any desktop computer, or tabloid or smartphone.

Can I make the transition moving only from a Desktop to a Web application without worrying too much about what device the user is using? I mean, if he/she is using a phone or a tablet and moves the position of the device from portrait to landscape. is that sorted by the user’s OS or does it need doing in the app?

Do I need to find out the size of the user’s screen and supply different layouts to cater for different size screens? I’m particularly wanting to avoid having to learn iPhone, Android, iPad and other tablet programming all at the same time.

An iPhone screen is MUCH smaller than a ‘small’ Desktop screen, so catering for it would normally be very difficult without compromising Web users with larger screens.

The solution is that you can set the Minimum size of a WebPage. This means that the screen caters for a ‘normal’ browser page, but on an iPhone will need to scroll around with your finger to see the whole page.

For normal content, on Desktop I open a new window at the ‘best’ size, on Web I usually set the Container to be ~1000 pixels wide and centred (to stop fields being too wide), but full-width where it makes sense (eg a report), and on Mobile I aim to fit within an iPhone 8 screen with the Container ~380 pixels wide, with fields stacked vertically and scrolling to see anything below, but full screen width for reports.

Thanks for that, David. Are you able to tell what device and screen size the website visitor is using so that you can send a different web page in each case`?

Yes, you can have an Event called when the browser is resize and determine the new size and adjust the layout accordingly. The Flex layout helps with web content plus GraffitiSuite have some useful tools for this. I use these in limited areas, but aim for the medium user rather than the tail-ends of users with tiny or huge screens.

Making the equivalent of ‘Responsive’ web pages in Xojo is possible, but much harder than in Web editing apps. Once I get it working and looking nice, I usually stop!

1 Like