Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to develop real NATIVE mobile cross platform apps without wrapping things? [closed]

I try to find a way to develop real native mobile apps, cross-platform. The amount of tools I found is huge, very huge.

All of the tools I have tried 'said' that the end result will be native, but in fact it isn't true. It is an executable with a webbrowser in it and some extra native layer/framwork to device specific features.

The reason I want a real native app is:

  • Speed and compact
  • Avoid browser issues
  • Market acceptance
  • Avoid easy/'script kiddie" reverse engineering

The products I have tried:

  • Appcelerator (does not work correctly on my system)
  • PhoneGap (does not create REAL native apps)
  • Embarcadero radPHP EX2 (uses PhoneGap)
  • Embarcadero radStudio EX2 (cannot create mobile/android apps?)
  • Adobe Flash Builder (Works very well but relies on Air, so apps are huge and no native devices such as vibration (posible, but must write it yourself)
  • Flash Develop (but same as Adobe Flash Builder)
  • ..... and some others ;-) like moSync......

Currently I have downloaded "RhoStudio" but has some doubts about it because in the introduction video they talk about the things that I don't want.

Target directions are in the first place Android, iOS and maybe in the future Windows Phone. Note: I don't have a Mac so I cannot compile it on a Mac.

Is what I want impossible or is there such product around that can do this?

EDIT: See my answer, the answer is NO!

like image 475
Codebeat Avatar asked May 31 '12 11:05

Codebeat


2 Answers

After 2 years asking this question I can say: NO, it is NOT possible, it's a myth.

All products I have tried use some kind of wrapping or use a second language as a layer to the call the native stuff. Although the libraries are native, the main program is not. The latest answer of Cosku with smartface.io is a good example, they claim it is native but it is NOT.

Why is it so difficult? The problem is the programming language (differences in language that makes it complex) that is required for a platform. It is too complex to translate a second language into the platform's main language and it's specific libraries, you can only achieve this by wrapping things with native binaries. Second obstacle is the needed compiler that must be able to run cross-platform.

But why rely on a second language or third-party development tool to build apps when the output is mostly the same is bad, the problem is perfectly illustrated in this image: http://xkcd.com/927/

The image is about standards, but that's what happen, creating a new standard for a standard. For example, when using PhoneGap, you have to learn the basics of the PhoneGap API. You rely on a 'new standard' calling PhoneGap. The problem with this is that you completely rely on PhoneGap support and it existence. It can introduce a second weakness in the lifecycle of an app.

IMO, if you want to wrap things to make it cross-platform it is not a smart idea to rely on third-party products and libraries. Better is to write a wrapper yourself, like I did and skip the bloat. A real benefit of this all is that you wrote the wrapper code yourself and you understand underlying structures. Besides it is easier to extend or change and you can skip the things you don't need.

Today I create and design the UI of an app in the longest existing and stable 'language' HTML with a javascript interface. The app can also run in a browser too and does not break when there is a specific function missing, like vibrate for example. You can not get the same results with phonegap, try it! You can design the app with responsive techniques at ease like a normal website (try this in Android for example ;-)). Technically, it can run everywhere, on any platform in a browser or webview but don't use any special Mobile javascript libraries! You don't need these special libraries, really, use the 'normal' library versions instead.

I have wrote a compiler/obfuscator for it to 'pack' the UI-source into just one file that will be loaded by the native shell. This is to protect the source, so it is not easy to view or modify the source.

The only thing I have to do, to support the app platform is write a native wrapper for it. If a platform dies for some reason (for example Windows Mobile in the past), I only have to write a new wrapper for it. This is easier to do than write the whole program again from scratch. Besides, when there is a new platform it can also run in the platforms browser too.

If your app not rely on specific hardware (like a game) or can run without special hardware requirements, this is the way to go to extend the life-cycle of your app. Use HTML5 and javascript to design the GUI and use a native shell to use specific OS features.

Is it slow? I have to say no. At least don't use any bulky and bloated special designed mobile javascript library stuff and don't use the click event on touchscreen devices, use touchstart instead. Also the HTML engines will/are improved these days and there is better support for HTML5 features that enables you to write powerful HTML5 webapps without the need to implement this in a native language.

IMO, this the way to go (for me) and my journey to find the best way develop mobile apps cross-platform and to extend the life-cycle. Hopefully, it can help you too to decide what is the best to do.

like image 88
Codebeat Avatar answered Nov 09 '22 21:11

Codebeat


For cross-platform native iOS, Android, Mac, and Windows apps, check out Xamarin. Code in C#, compile to native. For iOS, you can leverage the XCode tools for app layout, and Xamarin Studio integrates very cleanly with it.

And for the sake of completeness, PhoneGap has a worthy (yes, WebView based) competitor in TRIGGER.IO. While it's approach is similar to PhoneGap/Cordova, it improves the API for accessing native functionality, simplifies push notifications, and performs much faster cloud builds.

I am not associated with either of these products in any way... I just like them both.

like image 40
Noah Heldman Avatar answered Nov 09 '22 21:11

Noah Heldman