Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm interested in developing some applications for Ubuntu, using the SDK, for converged devices, including phones, tablets, and PCs. How can I detect which device the application is running on, and apply the appropriate layout, including interactivity differences, correctly?

share|improve this question
    
Don't detect a device type. Detect a screen size and orientation (doable by checking your window size), and lay out appropriately. (Possibly also being able to detect whether touch, mouse, or both would help: I do not know if that is possible.) –  sil Apr 5 '13 at 18:12
    
Unfortunately, none of those factors tell me what layout I should be presenting to the user. –  dobey Apr 5 '13 at 18:47
    
Why don't they? Display a layout appropriate to the space you've got. –  sil Apr 5 '13 at 22:32
    
Because it doesn't say anything about how the device is being used. The converged device solution is also a single device used in all three scenarios, so would obviously need some other way via API to tell the app to change layout. Apps shouldn't be implementing ways to do it themselves, which will break. –  dobey Apr 6 '13 at 12:04
    
I disagree completely. If I have an Ubuntu phone which is plugged into a monitor and keyboard, and the window for my app is on the monitor and is 800px x 500px, then my app should be rendering itself appropriately for that size. If the app is on the phone screen, and is 320px x 480px, then it should be rendering itself appropriately there. That is exactly the same as just changing the size of the window on a desktop. –  sil Apr 6 '13 at 13:13
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.