Prasanth
Prasanth

Reputation: 577

Is it possible to build mobile and web apps from the same code base?

Is it possible to have a single code base for a mobile(ios/android) and web application? I'm thinking about using react native or angular/nativescript. If you have attempted this what are the things to keep in mind before doing this. Also anything particular to for SEO?

Most importantly are there any real world apps with reasonable complexity that already have done this?

Upvotes: 0

Views: 1687

Answers (1)

Nathanael
Nathanael

Reputation: 5399

NativeScript actually supports this a couple different ways.

  1. NativeScript officially supports Angular; so you can create everything as an Angular application. Almost the entire app can be shared between Web and NativeScript; the only things that can't is the actual screen layout. In Angular for the Web; you use HTML tags so it might be somepage.html <div>{{somevalue}}</div> and for the NativeScript side you would have somepage.xml and it would have <Label text="{{somevalue}}"></Label>. This allows you to layout the app using the native components for Mobile, and web components for browsers, but use the same backend logic. There are several seeds and platforms that are designed around fully creating a web app and a NativeScript mobile app that can share virtually everything.

  2. NativeScript also supports VueJS; in this case you can again create virtually everything that shares much of its code base, the only thing is again you need separate layout files because again the web uses html, and NativeScript uses native components. So you have to have separate display files.

Disclaimer: I also work for nStudio; I tend to do non-angular type plugins mainly; but I do know that xPlat is really state of the art and has been used in several successful applications that our development studio has produced.

Upvotes: 1

Related Questions