Same templates for all platforms?


#1

When building a meteor project for both web and mobile (Android). Do I use the same templates? Or do I need to design and implement 2 template files for each view (a mobile and a web/desktop template)?


#2

you use the same templates


#3

It’s best to use the same templates, but use a UI framework which supports “Responsive Design”, so the layout can change automatically depending on screen size, and ideally one which emulates the look of native apps. Google’s Material Design is pretty good in that respect.

Regardless of which UI framework you choose and whether you’re using Blaze, React or Vue you will probably be able to find a pre-built package of UI components which makes it pretty easy. Personally I use Material Design Lite packaged by zodiase:mdl, but if I was to start again from scratch I would use the more recent Material Components.


#4

I would recommand to define mobile and browser code in 2 different local packages under packages folder and import them respectively with ‘web.cordova’ and ‘web.browser’ with lazy loading.
The goal is to avoid including browser templates and js inside mobile app bundle to reduce size.