Is it Reccommended to use JNI and C++ Code to make a shared library code between IOS and Android ?
I'am asking this because i think it not just saves us plenty of wasted time for implementing same logic in both platforms but also we will have the speed of a C++ core Backing the logic-process of our modules.
Update :
I ask my question in another way :
is it recommended to share a C++ Library for core functions of Android And IOS versions of a similar app ? or it would be better to completely migrate the codes to a multiplatform language ?
Since I remember my needs back then, I know that hybrid apps were not an option, Also JNI is not used for making cross-platform apps but the best use is to drive hardware peripherals via native UNIX scripts for Android or run c++ code on Android. So if we omit PhoneGap, Appcelerator, Ionic etc we will be facing several cross-platform technologies that have attracted many developer attentions so far.
Xamarin:
The framework was founded by the same people who have created Mono, an Ecma standard-compliant, .NET Framework-compatible set of tools. Xamarin offers developers a single C# codebase that can be used to produce native apps for all major mobile operating systems.
Unlike many other frameworks, Xamarin has already been used by over 1.4 million developers from around the world. Thanks to Xamarin for Visual Studio, developers can take advantage of the power of Microsoft Visual Studio and all its advanced features, including code completion, IntelliSense, and debugging of apps on a simulator or a device. Xamarin Test Cloud makes it possible to instantly test apps on 2,000 real devices in the cloud. This is by far the best way how to deal with the heavy fragmentation of the Android ecosystem and released bug-free apps that work without any major issues.
But being honest I didn't enjoy my first time face-to-face meeting with Xamarin. There were so many bugs and also speed and performance problems were bothering.
React Native
React Native is developed by Facebook and used by Instagram, Airbnb, Walmart, Tesla, Baidu, and many other Fortune 500 companies. It is an open-source version of Facebook’s React JavaScript framework. Because React Native uses the same UI building blocks as regular iOS and Android apps, it’s impossible to distinguish a React Native app from an app built using Objective-C or Java. As soon as you update the source code, you can see the changes instantly manifest in an app preview window. Should you ever feel the urge to manually optimize certain parts of your application, React Native lets you combine native code with components written in Objective-C, Java, or Swift.
The ones I mentioned above are not the only options, but since now they are the most used frameworks between programmers. But beware that Flutter is being publicly announced by Google in Google IO and maybe it may be going to create a hit soon.
Related
So I created an app on android studio and now my boss wants me to get it to work on Apple devices.
Is there a short cut to get an Android App to work on Apple devices ie iPhones, iPads and so on.
I really don't wanna create a whole other version for Apple devices.
Impossible. An option is to create hybrid application using Xamarin or Flutter which will run on both iOS and Android. That means you need to migrate you current implementation to hybrid app.
There are several options to do it and each of them has pros and cons so choose wisely.
Hybrid App
A hybrid app allows you to build a cross-platform mobile application with web technology. There are plenty of options you can use like Ionic, PhoneGap or React Native. But since you have built an Android app with the native code I assume, those existent features need to be rewritten in order to run on an iOS device.
Xamarin/Flutter
They are both create a native-like experience. The advantage of them comparing with hybrid app technology is the performance would be better in general. But again, it doesn't mean that you can just create an iOS app without changing any code, you'll still need to rewrite most of part in your app.
Kotlin Native
As an android developer, you're probably familiar with Kotlin. It's officially supported by Android team and It's 100% interoperable with Java. Kotlin can also be compiled to run on multiplatform including iOS. By this way, you'll be able to reuse a lot of existing Kotlin code on both Android and iOS so you don't need to use a new language to rewrite all the functionalities you had done on Android. The cons are It's an experimental feature so It's young and could change on the future and the reusability doesn't mean that you don't need to learn iOS platform.
We are a team of 5 members, one of us having basic knowledge of Android App Development. We are planning to develop an app having functionalities similar to Uber. Following are some things we have in mind:
Building one app through react native, where our concern is the availability of Maps and other API's in React Native.
Or developing native apps for IOS and Android platform.
What would be the better case, considering that we are beginners to app development.
As someone that writes both native iOS and react native apps I can say the following:
react native excels in speed of "net" development time. > 90% of the code is cross platform and there is no need to build your project after every change (one of the biggest pains in mobile development IMO)
however, most of my efforts in my current RN project are dealing with technical issues, compatibility of different packages & breaking changes. the entire ecosystem is less mature, development tools are inferior and there is way less documentation.
RN fits my particular, relatively simple, project and it allowed me to write for both platforms wo knowing Java\Kotlin. I would think twice before starting a more complicated project in RN.
BTW, Airbnb that wrote the above mention react-native-maps, recently announced they're sunsetting RN development: https://medium.com/airbnb-engineering/sunsetting-react-native-1868ba28e30a
EDIT: I found myself wring a full blown production app in RN for the past 9 months and this is my current perspective:
RN is constantly evolving. The facebook team is doing an incredible job making the platform better.
Javascript can be tamed using typescript and working with design patterns (Im using redux-saga)
We use one codebase and repository for FE & BE: that's the biggest advantage IMO. The entire team is using the same language, we can review each other code and assist in tasks.
It may require some hacking but I have yet to encounter a situation where I couldn't achieve something that was required by product in RN.
The only real downside with RN is performance. By design, RN is less performant than native apps. For many apps, the difference will be negligible but if your app is heavy on animations, this is something to consider. The FB team are working on a big architectural change that's supposed to address this. (rumours say that the version of RN FB are using internally is way more performant).
If development effort/cost is not a matter for the organization, just go ahead with option 2: Developing native iOS & Android using swift and JAVA. Native development have access to complete capabilities of mobile development. It is very rich in UI design, performance, scalability and many other things. Lot of support and tutorial available in internet if you stuck in middle.
Option 1, Developing on react native: If majority of developers are experts in web development, java script and React JS please go ahead. It requires less development effort because one project will support for both android and ios. In this option, still you need native app development knowledge to develop custom, complex views and exported to React native.
Explore through internet to know the differences.
Don't worry about it because React-native-maps is good npm module for maps
You can find Github
doc here
It works great for android and ios
And more answer here: Which is best map to use on react native
But, in personal opinion i love native app, it's the best.
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.
Microsoft has introduced his new Visual Studio, with compatibility to develop multi-platform applications for Android, iOS and windows.
This is a very good news, for developers, that a large and reliable company produced such a thing. It can make life easier, a lot.
But, as you know, there are always disadvantages when you get advantages. So I want to know:
1) What is the difference between developing native apps for each platform, and using this kind of tools? What is the disadvantage compared to using for example Objective-C or Java for iOS and Android separately?
2) Is there any dependencies in order to running developed apps on different OSs? Something like .NET framework?
3) Is there any performance cost? Or works just like native ones?
4) What kind of apps are supposed to be developed with such tools?
In my point of view , this not good idea to develop android or ios application in XAMARIN. First of all performance issue occurs. You can not achieve performance like native application.
There are some dependencies like Xamarin compiles C# to native code, but still relies on the Mono runtime to do a lot of its work.
Native, no cheating – this is native. But there is an overhead, it isn’t like ObjectiveC native. The apps are going to be larger – this minor stuff matters when you are trying to get the max oomph out of your very resource restrictive mobile device.
You still need a mac for ios:-)
A huge emphasis on better app patterns like MVC or MVVM, because user interface is still native. You can write about 70% reusable code using Xamarin, but the last 30% or more depending upon your app design and nature, has to be native.
Generally speaking, in my experience, I’ve had better luck finding support and code samples for native, than for Xamarin.
And like I said, you still need to know ObjectiveC and Java – even if you are using Xamarin.
And Visual Studio + Xamarin = $$$$$. Plus a Xamarin developed product, while superior than HTML5 and Packaged HTML5, is going to cost you more. You have to evaluate if your needs justify the cost.
However, in practical application, I don't think it is very useful. Consider this... If you are coding in C# then this code has to be translated into objective-C or Java, and that translation depends on the Xamarin SDK. If Apple releases 4,000 new APIs in the next release of iOS tomorrow, how long will it be before the Xamarin API allows you to call those native APIs? And multiplied by two if adding Java. If you can't wait, then you code what you can in C#, and then write native code for the rest, but now you are supporting three code bases, and the advantage of Xamarin flys out the window.
I provide some links of debate on this topic
http://willowtreeapps.com/blog/xamarin-or-native-development-tools-for-ios-android-projects/
Android Xamarin limitation
https://developer.xamarin.com/guides/android/advanced_topics/limitations/
https://www.linkedin.com/grp/post/121874-5848849341191569409
https://www.quora.com/Why-would-people-build-native-mobile-applications-for-Android-iOS-using-Java-Objective-C-when-they-could-use-Xamarin-C-for-all-platforms-if-license-cost-isnt-an-issue
Why I Don’t Recommend Xamarin for Mobile Development
I have one simple question, that is can I convert my android .apk app into ios using any software? If yes, then please give me the name of that software. If any alternative method for that please guide me.
Google has a tool to convert the back-end, nothing for front-end though
http://www.xda-developers.com/google-tool-helps-developers-port-android-apps-to-ios/
There is a new startup that clains to convert the APK to IOS.
It's called MechDome.
The goal is very simple and attractable:
Reduce time to market by eliminating cross-platform development. Automatically convert your existing Android apps to high-fidelity, native iOS apps.
There is nothing out there that would convert apk into ios app. To my knowledge there is also nothing out there that could translate android code to IOS. The operation is simply too complex for a simple tool to manage.
However, there are tools you could use to make your apps (developed by you) work across multiple platforms. I'm sure there are more, but here are 2 of them I found in minutes (look into them if you are interested): Apportable, Phonegap (discontinued as of 2020/03. It was made obsolete by ProgressiveWebApps - PWA).
In past decade or so WebApps have been picking up for anything that is not too graphically demanding as they can run on anything that has a Web Browser. With this style devs pretty much open their website in a platform-specific executable and it looks like an app.
As for your existing app depending on complexity of your software you have to rewrite from a little to a lot of code to adapt to IOS APIs.
In short: No. Unless your app is build on multiplatform framework, converting means manual adaptation.
There is no known way to convert an android app to iOS. MechDome which is a Developer Tool that Automatically Converts Android Apps into iOS Apps seems to have stopped as of 30/03/2021. link
However if it is your plan to launch android and iOS app from one coding project, use Flutter which allows you to launch on both platforms simultaneously.
Flutter is Google’s mobile UI framework that provides a fast and expressive way for developers to build native apps on both iOS & Android, using a single codebase.
Get started here link