2

I am an Android programmer developing a simple mobile app (very similar to a regular messenger).
I use a client-server architecture. Server is written in Java and runs on Google App Engine. Native Android client makes HTTP requests to server, and server sends a GCM message to addressee(s) or responds with a JSON object to the caller. There is SQLite RDBMS used as a cache.
Writing a separate application, from scratch, for each unique mobile platform is expensive. And now, when the application is almost ready, I starting to think how can I easily port it to other mobile platforms: iOS and Windows Phone. Please, if you have any experience in creating cross-platform mobile apps advice me the easiest way of developing and maintaining such apps.

I have found several options so far
cross-platform

Delphi XE          | Delphi, native compilation  | Delphi developers
Unity3D            | C#, UnityScript, Boo        | Game developers

I look towards j2objc, JUniversal, and Appery.io (roughly saying, PhoneGap wrapper). My questions is Which of these products are mature?

Especially,

  • Can I use RetroFit and ActiveAndroid together with one of them?
  • Can I receive push notifications (GCM / APN / MPNS) using any of this products?

ps. I refused to use Unity3D and Delphi XE, cause I think they greatly increase the application size. I refused to use Xamarin, cause I am not a .Net developer.

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259

5 Answers5

1

J2objc is in a great state it is strongly supported by google. And has an active community working on it.

You can find a lot of documentation here: https://github.com/google/j2objc/wiki

The code produced by J2objc is used in several high performance apps (e.g., Mail) from google. So this product is definitively production ready.

As with all other projects there is a steep learning curve. J2objc has also example projects you can use to learn how it works.

Michael
  • 32,527
  • 49
  • 210
  • 370
  • I usually give myself some time to confirm or refute the answer. Nonetheless I've changed the wording of the question to fit your answer =) So it is the main candidate on acceptance now. – naXa stands with Ukraine Apr 17 '15 at 14:01
1

If you want to only develop in Java, RoboVM is probably your best bet. It supports the full JRE API, including secure sockets for RetroFit. iOS native classes can be wrapped to work with RoboVM's memory management, so you don't have to learn another language.

j2objc doesn't support secure sockets yet, so porting RetroFit requires creating a j2objc-specific HTTP handler for OkHttp. Push notifications would need to be written in Objective-C or Swift, as would the app's UI.

ActiveAndroid looks problematic with all of these options, because it uses Android's SQLite API, which relies heavily on Parcels and other Android serialization support.

tball
  • 1,984
  • 11
  • 21
1

Well here is my two cents.

Unity3D will provide the best multi-platform transition, although it is aimed at more or less at game development. If you plan your code out well enough it will port very easily.

Android Studio (https://developer.android.com/sdk/index.html) is the got for Android development but you wont get much cross platform compatibility out of it.

Anything using C# is .NET so throwing Xamarin out keeping jUniversal is sort of weird but i get it because you are used to java.

Of the list Xaramin formally MonoDevelop is the most mature I think. And is also what Unity uses although they use a slightly modified GUI.

At the end of the day each will have their own pitfalls and strengths. I would say since you learn towards jUniversal go with it.

webternals
  • 161
  • 7
1

I like Unity3d because of the ease to deploy to the many platforms. But for your task it may be too big a tool. Your project sounds too simple for it. Unity3d is Free (T&Cs apply) so it makes it appealing, but Cordova/PhoneGap sounds more like the tool for the job.

Andrei Bazanov
  • 352
  • 2
  • 11
1

I've used PhoneGap/Cordova, Xamarin and Unity 3D as mentioned above. I've also used hybrid solutions which I found the most effective. With hybrid apps you can reduce significant overhead with external libraries and engine!

Depending on what you want to do you could take your app and have it use a common full screen WebView widget and port it over to iOS's UIWebView and Windows' Phones' IE widget. Once you get the initial framework setup for just the webview widgets you can plug the HTML,JS,CSS data and inject it into your app. That way you can keep the same main code base and modify the webview source simply. This will replicate the behavior of cordova/phonegap/xamarin and will save you on overhead.

I've also used the Chromium project from Google for iOS/Android and use webRTC to redisplay the web apps with optimum rendering.

There are many viable options for doing it yourself without the overhead from all the other solutions. Plus you get the option to incorporate native database features such as CoreData and EntityFramework for iOS and Windows respectively. Along with database native features are countless other benefits.

apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69