I want to develop an application for both android and iOS devices. Is there a way to develop the application once and deploy on both? Or is it a must to develop for each platform separately?
If you want applications that provide a native experience, then you will have to write separate applications.
I think the best place to start is with a really nice web version optimized for mobile browsers. I think the nicest web apps are better than a lot of the native apps, but they aren’t competitive with the better native apps.
It all depends on the type of application you want to develop. If it’s a game, I suggest you write most of it as native code, and take advantage of the fact that OpenGL ES 2.0 is supported natively on both platforms. Obviously all of your Java code won’t be reusable on iOS, so anything that can be made as a portable native library helps reducing the amount of non-reusable code.
Using Qt, which is a C++ framework for cross-platform developement that has both a LGPL and a commercial license, you can develop for both platforms and simply recompile your app from the same source. As a bonus, you could target Windows, Linux and Mac as well.
Keep in mind, however, that Qt renders its own controls, so widgets will not look native on Android nor on iOS. Also, as with all cross-platform frameworks, it will provide you with the lowest common denominator in terms of features.
From their official blog:
With Qt you can develop truly cross-platform applications that will work on desktop, embedded and mobile platforms. Qt 5.2 introduces full support for Android and iOS platforms and thus enables the creation of cross-platform mobile apps that are packaged and deployed to both Google Play and App Store from one code base. Instead of writing two versions of the same code with two different technologies, you can write it once with Qt!
Apple App Store might not accept apps that use dylibs, however, which might force you to use the commercial license for closed-source apps:
On iOS it is possible to use a dynamically linked version of the Qt libraries, and have them bundled with the application. This allows the app to use the LGPL license for Qt whilst allowing the app itself to be closed source. It remains to be seen whether Apple will accept applications that bundle dylibs into the iOS App Store. If Apple does not accept applications that use bundled dylibs into the App Store, then it will be necessary to link Qt statically to the application. And as the Qt for iOS port uses the LGPL version of Qt, the rules for statically linking with LGPL will kick in – this can be a problem for closed source apps.
Finally, since Qt is a C++ framework, you will need to use C++ to develop your app.
There are a lot of choices. It depends if you want a Native experience or if you want things to be in a webview. With native experience you may have to do some native coding, but it is still way better than developing 2 separate native applications.
Below are some that i have experience with.
Codename One is another, for Java development on both platforms. No experience with it, though.
If it’s a game or primarily graphical app, BatteryTech Engine will do what you want. Yo still need XCode to build for iOS, but otherwise it’s a single primary codebase for both platforms.
I started using NativeScript and it looks promising.
I have used lots of cross-platforms in the last few year, and the from my perspective Xamarin is the best because at the end it, you can tell if the app is cross-platform or not. but with Xamarin it compiles to native so no apparent difference between them in terms of UI.
You can start here: https://www.xamarin.com