T
T
TitanFighter2017-09-12 15:56:10
Angular
TitanFighter, 2017-09-12 15:56:10

Is it possible (is it possible to use) the same code (for example, Angular or Vue) for both Web and Mobile applications?

Good afternoon
I am a back-end engineer, I know js a little, I communicate normally with html and Bootstrap.
For quite a long time I want to try rest and some kind of web front (or Angular or Vue) + mobile application development. I have been reading various articles for a long time, but I can not find the answer to my question.
There is, for example, Bootstrap, which adjusts the template to the size of the browser (both on a computer and on a mobile phone).
As I imagine, Angular or Vue can also fit the template to the size of the browser.
Question: Can the written code for the site (Angular or Vue) be used for a mobile application (since the code for the site already contains markup for a mobile phone)? Those. in fact, I want to make a mobile application from a site of the required size.
Or is there one code for the site, another code for the mobile phone, with the only thing in common - js + syntax or Angular or Vue?
Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
I
Ivan Bogachev, 2017-09-12
@TitanFighter

Ionic for Angular has already been mentioned. For Vue, there is Weex . Allows you to build an application for Android and iOS. I tried to make a small application with it under the bucket. I can highlight the advantages that I saw (it is possible that something will be different in a large project):
- Vue out of the box, a simple and understandable tool, which is nice
- Does not slow down
- Most of the code is easily transferred from the web version without changes
AND cons:
- Starting a project without knowledge of Java is quite difficult (I was looking for an error during the first build for about three hours)
- Small community, little information, there are practically no questions on the topic on StackOverflow
For myself, I concluded that you should not use Weex in the near future in a large business (there is a risk of failing all the deadlines due to lack of information), but for your small applications it is quite possible to try, especially if you like Vue. I think it's worth keeping an eye on the development of this project - maybe in half a year / a year it will already be possible to use it safely.

V
Vitaly, 2017-09-12
@vitali1995

You need to use something like Cordova or Ionic. They use the front end of your web app and allow you to embed native experiences, making them a mobile mashup. In the right places in the code, a check is made on which platform the application is running on (browser or cordova) and platform-specific code is executed - this way you write one code for different environments. For desktop applications, there are similar counterparts, such as Electron or NW.js

D
Dmitry Mironov, 2017-09-12
@MironovDV

There was an experience of writing a similar project. The task is to make a mobile version, but they promised that in a week we would make an application based on the mobile version. Made with AngularJs + https://ionicframework.com/. The mobile version slowed down, because. ionic imposed its own overhead + there were problems that had to be spent time on, for example, ionic has its own history logic, page caching when switching back to forward and other minor points. It is also not clear how to manage releases, because the mobile version can simply be updated, it will not work with the application. For myself, I concluded that such an approach is needed for prototypes or first versions.

D
Dmitry Kuznetsov, 2017-09-12
@dima9595

The main problem, well, at least for me it would be, is the layout of the site for mobile phones. I did not understand js frameworks, but it will be possible that some code for PC will not work for mobile phones. But this is very unlikely. And so, according to the idea, nothing should break.

Y
Yeldos Adetbekov, 2017-09-13
@dosya97

Bootstrap is basically a UI framework. Vue, React, Angular - ux frameworks. More than responsive design is possible on them. They build the business logic of the project, which is equivalent to the backend.

A
Aleksei Podgaev, 2017-09-28
@alexiusp

If the application does not use any features of the mobile platform, then there is no problem using the same code - adaptive markup (you can combine the same bootstrap and angular) and cordova to help. You can also look in the direction of the recently appeared WPA - there you don’t even need to compile for the platform and upload it to the market.
If the functionality on the mobile platform is slightly different from the web version, then anyway, using cordova with plugins and splitting the code into git repositories, you can achieve almost complete reuse of the code, although you will have to spend more effort.
Ionic, built on top of cordova and angular, is also a good solution for hybrid applications.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question