All previously mentioned templates, except Framework7, are best suited for desktop usage. Even though most of them like bs4Dash work quite well on mobile platforms, you don’t get the native look and feel that you have with mobile apps like twitter, as shown on Figure 23.1.
The goal of this part is to introduce you to mobile development for Shiny. We are going to reconstruct the shinyMobile package with the help of charpente and all what we have learnt since the beginning of the book.
Mobile app development consists in developing an application for mobile devices that is tablets, phones (Android, ipadOS). We call a native app when it is dedicated for the specified platform. For instance, iOS applications are developed using Objective-C or Swift whereas android apps are mainly developed with Java. Those apps are faster than web apps since they exploit the full capabilities of the platform. The UI is also more consistent, they may be installed via a stores (App store, google play) and work offline. The main issue is the need to know multiple languages and maintain multiple code bases.
Isn’t there something between pure web apps and native apps?
Progressive web apps or (PWA) improve classic web apps capabilities by being able to have a full screen display, being installable, provide a launch screen, like native apps with a consistent UI. They must obey to three rules:
- Being capable: media control, file system access, …
- Being reliable: fast and usable offline. Transparent failures.
- Being installable: Standalone use, launch from user’s home screen.
There are several criteria to meet the installable state:
- The app must be served over HTTPS.
- Include a manifest, that is a JSON file specifying app metadata like its name, short name (
short_name), icons to use for user’s home screen and launch screen (displayed image before the first paint), the start url (
start_url), the display mode (generally standalone), the splash screen background color (
- Have a registered service worker, which can cache the app content, thereby making sure to provide offline support.
Once all criteria are fulfilled, the web browser may shows an installation prompt to start the process.
Let’s meet in the next part to start your mobile development journey!