Ossi's favorite workshop: Build an app for the multi-device world
By Rob Orgiu, DevRel Engineer, Large Screens / Sasha Lukin, DevRel Engineer, ChromeOS
This talk was a workshop, so I was able to replicate what was shown live on my laptop. In this workshop, we looked at how to adapt a mobile app to different form factors using modern Android development techniques. Specifically, we looked at the following points:
Adaptive layouts with Navigation 3
The new navigation library, Navigation 3, offers many new advantages that make it easier for us to develop navigation logic with Jetpack Compose. We looked at how easy it is now to implement a list + detail view. This means that on a smartphone, a list is displayed on one screen as usual, and when you click on an item, a second screen is displayed with the details for that item. On a device with a larger display, such as tablets, foldables or Chrome Books, the detail view is then displayed directly next to the list, i.e. on one screen. This makes optimal use of the available space.
Drag and drop
We can no longer imagine Mac OS and Windows without drag and drop. Android also offers this functionality, but it is not very well known and is not implemented by many developers. We looked at how easy it is to implement this with Jetpack Compose. This is particularly useful on tablets, foldables and Chrome Books, as you often have several apps open at the same time. This allows you to send a photo from the gallery app to a contact on WhatsApp using drag and drop, for example.
Keyboard shortcuts
With the increasing popularity of Chrome Books and tablets, more and more Android users are using a keyboard with their device. Here, we were shown how to easily implement a feature in a chat app, for example, that allows users to send a message by pressing the Enter key. This allows us to optimise our Android apps for use with a keyboard.
Context menus
Just like drag and drop, we are used to being able to right-click on elements in applications in Windows and Mac OS and have a context menu appear. As more and more users operate their apps on tablets, foldables and Chrome Books with a keyboard, they expect this in Android apps too. We have seen how this can be easily implemented with Jetpack Compose.
Conclusion
The workshop was very exciting. I myself also use a foldable (Pixel 9 Pro Fold) and a tablet (Samsung Galaxy Tab S7+). That's why I know all too well that many apps are not optimised for larger displays and mouse/keyboard use. In this workshop, I learned how easy it is to implement small features that make life easier for users of Android devices with large displays and hopefully make using our apps even more enjoyable.