M
M
Mostwanted2015-10-30 16:20:50
API
Mostwanted, 2015-10-30 16:20:50

How to take out the common code for different mobile platforms?

Good afternoon.
I am developing a small service, at the moment there is a frontend on AngularJS and a REST API on Node.js. Native applications for Android / iOS / Windows Phone are planned. Is it possible to move all the work with the API into a separate lib and use it on all three platforms? Because maintaining one lib with an API and other small functionality would be much easier than writing everything from scratch for each platform (except for the UI, of course). In which direction to dig, how are such tasks solved?
PS heard about Cordova / PhoneGap, but possible brakes repel. I would still like a native solution.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Voronov, 2015-10-30
@newross

Xamarin - no brakes, normal flight.

I
Igor Kalashnikov, 2015-10-30
@zo0m

I use Appcelerator Titanium
The control code is written in JS The
view is also described in JS, but native components (buttons, labels, views) are created, which are controlled from JS through bridges (because of the bridges, there may be a speed problem)
For the ribbon, in which you need to create a lot of objects, I made a WebView inside which I deployed an Angular application that sends / listens to events up through the api (like Ti.API.fireEvent('webview:user.click'))
To be honest, it does not work perfectly, and the native application , of course, faster, and someday I'll probably do a rewrite, but in principle, so far more than happy
Since you already have an angular application, and if you can adapt it to a mobile phone (change the layout), the first thing I would do is wrap it in PhoneGap, make an MVP, and then see if you need a native or not. Maybe you have nothing to slow down there.
I cannot recommend Appcelerator, it has been paid for some time now.
An example application is in my profile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question