I have to develop a simple application for Android and IOS (Gui with use standard android/ ios components - both have equivalent components for what I want use). So I'm looking for a cross-platform solution that can make it easier. I found nativescript with angular and react native. Both look cool and I read a lot of positives and differences between them. Now I prefer nativescript with angular because of pieces of code in angular which I can use in web.
Here is but:
But I need be able to send some bytes via wifi (not to web or via http). And I can not find a solution for it. It's easy to do it in native app development. So is it some option to call java code from native script or how can it be done?
Or is in this case is better / only way to achieve it use native app development?
Thank you for any answer.
EDIT: I found manual to create native plugin and it works:
https://www.nativescript.org/blog/plugins-and-jars
For react it is pretty easy, you can wrap any native code within a react module. Have a look at this documentation page: https://facebook.github.io/react-native/docs/native-modules-android
For native script you access native APIs via JS code, see here: https://docs.nativescript.org/core-concepts/accessing-native-apis-with-javascript
I know Cordova isn't in question, but having a big chunk of work done in Angular for web, you could take it into consideration too. Integrating any native functionality/sdk is super easy with Cordova.
Related
I need to develop a native app for both OS.
This would be a simple app, not too complex.
What would you recommend for me to use? I only have little Javascript knowledge. Don't know anything about React or other frameworks.
Thanks in advance for your help.
I would recommend NativScript if you know JavaScript as for Flutter you need to learn Dart.Here is the comparison I posted for NativeScript and Flutter.
I use Nativescript with Angular but you can use plain JS as well.
Another reason to use Nativescript is theier marketplace and if you use some pre-built plugins, the time for building of NativeScript applications will be decreased
Hence you are Looking to develop application for both android and ios with java script
You could use following tools / frameworks
phone gap
as and option you could use
ionic
these could be best if you don't prefer react native or native script
else if you are okay with angular and jquery then
mobile angular
jQuery Mobile
also you can drag and drop themes with ThemeRoller jQuery Mobile
these above mentioned tools / frameworks has huge amount of tutorial in you tube and other blogs (my personal choice would be ionic / phonegap)
NOTE:
**phone gap free for personal use
**others are completely free
For both OS, i would recommend Flutter, open source mobile application SDK developed by google.
Flutter is Google’s mobile app SDK for crafting high-quality native
interfaces on iOS and Android in record time. Flutter works with
existing code, is used by developers and organizations around the
world, and is free and open source.
For more information on flutter ,see flutter.io
For flutter examples here
I'm maintaining a plethora of apps for one of my clients all of which have native projects for each of the three main platforms. The apps are relatively simple in functionality. My client wants to always take advantage of the latest features in each platform for marketing opportunities. They also want to appear to be a native app (responsive, not laggy). I haven't followed cross-platform development very much lately, so that's why I'm reaching out to SO.
My initial idea is to write a C++ library that has all the functionality shared by the three platforms. Then, for each platform, I'll write some network, file access, and UI-code that connects the abstract library code to the concrete platform.
Of course, this is exactly what cross-platform systems aim to do. Would it be a waste of my time to write the above myself when this has already been done by platforms like PhoneGap? My concern is that I would be dependent on a third-party. If I write the code myself, I have full control, and I will always have access to the latest features.
Hope to get some pro's and con's.
Thanks!
Yet a third option (after Facebook's React Native and Microsoft's Xamarin) is Google's new Flutter and as the other answers suggests "then writing the Windows app purely natively". BTW, React Native does have Windows support the lack of which in Flutter could be a plus or a minus depending on how you look at it.
Have you considered using React Native for iOS and Android, then writing the Windows app purely natively?
There are tons of articles out there about pros and cons for React Native.
PhoneGap is just a web, written in HTML, CSS and JavaScript. React Native actually renders native components for iOS/Android.
There is also Xamarin. It supports multiple platforms and uses c#. The new features from the native languages all work great.
I did some research but couldn't really pin-point and couldn't really come to a conclusion on which one to use and why? Would appreciate some helpful links and differences that can help me reach on a conclusion.
Ionic uses web-based technology. You're basically building a website in a native wrapper. You're still building the app in html/css/js and it will be shipped as such. You might have access to a couple of the native functionalities but that doesn't make an Ionic app a native one.
Titanium is a hybrid technology. You write your code in javascript. Through a layer this javascript talks to native components. So if you make a "Window" in javascript it natively is translated to a window object in Android/iOS. It then also behaves completely native because it actually is. It is as performant as native, as it is native. You just control it with javascript in the background. A well made Titanium app is indistinguishable from a truly native app.
In core, thats the difference.
Titanium uses (like RN) the proxy pattern. The app is in runtime a real native app without limitations. Ionic uses phonegap/cordova under the hood. This is web technology. The webview and especially the used framework consumes a lot of battery and traffic. the performance is suboptimal because web is a universal machine.
Read a number of questions on writing in just one language for both iOS and Android and what I learned is that it depends on the special functions you need. What I want to build is a very simple app that will ask the user what he or she is doing. We need this for billing the customers but my co-workers keep forgetting to update their time-sheet, so I want to write this little app that pops-up every x minutes and asks them what their doing. At the end of the day the list will be sent by e-mail or whatever.
Anyway.... is a pop-up from an app from the background a 'special' function? Can a general language be used on both for this?
Edit: I have searched for crossplatform tools, but all replies talk about specific functions that still require native coding. That is why I was wondering if something as simple as a popup with question and entering / saving a text, would be native or could easily be handled with a crossplatform tool.
You may use Xamarin to create a cross platform applications. I am satisfied with Xamarin platform at the moment. I have been working on native iOS, java for Android also.
Please keep in your mind that, it would be great if you are familar with these platforms because Xamarin is just a wrapper of methods which exist in the native platforms. Since I am familar with native Android and iOS, it makes me comfortable when I work on Xamarin platform.
My personal recommendation is to stick with Native platform. But if you have to work on cross platform, I believe Xamarin is a good option.
Pros:
If you are familiar with C#, it will help you a lot to develop an application for android, ios and windows platforms in Xamarin.
It is demanding platforms, and many big companies are looking Xamarin developers especially after the Microsoft acquisition.
Cons:
You need to buy a license.
There are other platforms as well, but I did not use any of them. Here are some of them
Cordova
HTML5
Unity
PhoneGap
Appcelerator
Corona
Qt
You may find useful the following urls
http://appindex.com/blog/ten-best-cross-platform-development-mobile-enterprises/
http://www.developereconomics.com/pros-cons-top-5-cross-platform-tools/
For sure what you describe can be achieved with using Ionic. Its a free solution and it comes with a lot of good documentation to get you up and running quickly. You'll need to use AngularJS for developing apps with Ionic so that might be a good solution if you know your way around that framework, or if you are familiar with Javascript or have done some web development before.
On regards to your question regarding native functionality (by popups I assume you mean notifications) Ionic sits on top of Cordova so there is a huge amount of native plugins that you can use to implement native functionality. You can take a look at plugins here.
Hope this helps!
Can Nativescript build apps for web as well?
As Ionicframework and similar uses Cordova to build Android and iOS the same code there can be served by an HTTP server to the mobile or desktop browsers.
Will that be possible with the apps built with Nativescript, using same code base for web version of the app?
Nowadays Angular integration is on the way, and using Angular for the mvc kind of things (like data bindings, events etc.) and using Native for the device apis, platform apis and native gui would help in an unequaled way.
Angular parts can be used in the browser as well when built for it. What to do with the xml written for the gui templates in Nativescript, they could be converted to proper html for web built of the app, as Nativescript itself already uses a unified gui api for different platforms, that could be possible. And lastly, native calls made in NativeScript would be ignored in the web build.
It would be great to build for Android, iOS, and Web with the same exact code base.
tl;dr: No
Longer: The big difference between the Cordova/Phonegap based technologies (such as Ionic and Supersonic) and the Dynamic Runtime based technologies (such as NativeScript, React Native and Titanium) is that the first uses a HTML approach where the application is run by WebKit/Blink in a WebView. Looking on the Dynamic Runtime technologies there's no HTML Engine running your app, but rather native views and widgets. The framework (in this case NativeScript) is "just" a bridge between Javascript and the native language of the device.
However, depending of how you architecture your code, you can create Javascript which will be usable in both a NativeScript environment as well as in a browser environment.
Edit: The above means that you could reuse some of your code. There'll still be NativeScript specific code.
Edit2: There's an ongoing project to enable usage of Angular 2 in NativeScript. Please see current status in the issue: https://github.com/NativeScript/NativeScript/issues/103 Also note that the Telerik NativeScript core developer Valentin Stoychev is saying
The idea [is] to enable as much code reuse as possible between your web and mobile apps.
So: Yes on code reuse - no on exact same codebase.
Adding to the (correct) response of Emil - I do not think it is possible to have any significant portion of the app shared (even for the logic part) since {N} apps mostly utilize the Nativscript observable implementation which would probably 'leak' into your models / view models.
Having said that, I suggest you to monitor the work happening on integrating Angular2, which would probably mean a larger code sharing potential (with Angular2 web apps)