Developing cross platform mobile application

42,149

Solution 1

My answer here covers some of the technical limitations of cross-platfrom tools but let me expand a bit:

I think that cross-platform tools have historically always been also-rans because such tools have the wrong philosophical focus.

All the selling points for cross-plaform tools are the benefits they bring to developers. They are sold on the idea that they allow the developers to write-once-run-anywhere. They are sold on the idea that they allow the developers to expand their market without learning new APIs. They are sold on the idea that they allow the developers to slash cost and time to market.

What cross-plaform tool are NOT sold on is the benefit they bring to end users.

Benefit to the end user is not a selling point because cross-platform development is seldom a benefit to the end user. The end user does not care how hard the developer had to work to bring the product to market. Nor do they care how many platforms the app can run on when they they don't use but one platform. They just care if the app does what they need it to on the hardware they need to run it on. Unless they have a specific need to run the app on many different platforms, the fact that it does brings them no value.

Conversely, the inevitable compromises of making a cross-platform API mean that all the apps created by the API will be at best B-grade on every platform. They will never be the best tool to use on each platform.

All this means that in most use cases, cross-platform tools give the end user an inferior product compared to ones made with platform specific APIs. The end user will always have a better choice.

You make money in the long run by giving end users the most useful tools. If you don't philosophically concentrate on making the end user's life easier and more productive, you are pretty much doomed from the outset. End users have lots of choices and if your tool isn't one of the best you won't make it in the market.

You should only use cross-platform tools if you think, "the users will really benefit from running this app on many different platforms." If you start out looking at cross-platform tools solely because they will make your (the developers) life easier, then you have picked them for the wrong reason and they will hurt you more than they will help.

Solution 2

There are several approaches to cross-platform development on mobile devices. Of course they all have limitations. No solution manages to take advantage of all the device's functionalities the way a native application can.

Re-using code

While all mobile OS don't use the same development language and API you can sometimes share some classes or logic tier code.

C++ for example can probably be re-used for an iOS application, for an Android app by using the NDK, for a Symbian app since they are developed in C++, etc.

Some solutions also offer the possibility to write the app in an other language than the one normally used by the device. The most famous (in fact the only one I know) are commercial and based on the Mono project (C# development):

But I'm not sure we can really call this cross-platform development since the re-use of code is limited depending on the device :

  • Windows Phone 7 will not allow native code development (maybe in further updates)
  • AFAIK mono like project do not exist for all platforms (yet?) bada, webOS, maemo, etc.

And the UI part also stays specific to each device.

Web development

A regular answer when asking about cross-platform development for mobiles is web development. We would then need a wrapper, that will use the mobile browser, to make it look and behave like a native application. That is how some of the cross-platform framework that we will see further on work.

The rise of HTML5 brings to web development functionalities that could only be done with a native application like geolocation, off-line application, local storage.

We can found more and more frameworks to develop web application for mobiles with a native look and feel by taking advantage of the latest web standards HTML5, CSS3, Js:

But HTML5 is still very young and implementation may vary from a browser to another. Most default mobile browsers use the WebKit engine (main exception being Windows mobile/phone using Internet Explorer) and even so they don't necessarily support the same functionalities. Local database is still awkward to work with and we can't be sure how it is going to implemented by the different browsers. Moreover, even with HTML5, web development is still very limited compared to a native app. You can't access contacts, camera, accelerometer, etc.

Edit: Earlier this month the W3C have delivered some warnings about the evolution of HTML5: Article from ZDNet

So it will only suit a limited category of applications.

Cross-platform frameworks

And than we have the cross-platform mobile applications frameworks. With which you can presumably develop once and deploy on different platforms. These solutions usually focus on iOS and Android and rely on the WebKit engine. They offer more interaction with the phone functionalities while developing with web technologies. The most well-known are Nitobi PhoneGap, RhoMobile Rhodes, Appcelerator Titanium. But many others are out there and don't all use the same technique like MoSync which translate your code to it's own intermediate language before compiling it for the desired platform.

[ 1 ] Remember that Apple has a special policy about apps written for their platform. They don't seem to be blocking these apps at this date but it is an information that should be taken into account. Edit: Apple has changed this policy since September 9.

Solution 3

You get some commonality when deploying as a webapp (html5 as mentioned above) but for rich native apps the APIs are completely different for the various smartphones.

HTML5 may improve things somewhat but to do interesting things you need to go native.

There are 'cross platform' smartphone frameworks such as Phonegap but I've heard mostly bad things about using it for "real" work. (lots of overhead etc)

Solution 4

Yes, html5 is getting some attention. You should also look at this consortium & platform to come in Q4. Not sure about the success of that project, as it sounds like a huge challenge, but here are the details:

Website: http://www.wholesaleappcommunity.com/default.aspx

News: http://news.google.de/news/search?aq=f&pz=1&cf=all&ned=us&hl=en&q=%22Wholesale+Applications+Community%22

WAC aims to publish its initial specification and components of its SDK to developers in November. This specification will be based on W3C standards and create a strong platform for developing rich mobile web applications. WAC will also provide backwards compatibility for devices based upon the current JIL and BONDI specifications. (http://www.convergedigest.com/Bandwidth/newnetworksarticle.asp?ID=31021)

.

It IS an international coalition of around 25 telecom companies that's aiming to create a platform open to all developers and selling to all mobile phone users. (http://www.downloadsquad.com/2010/02/15/atandt-wholesale-applications-community-is-a-platform-not-an-app/)

Solution 5

As far as I know most of those devices are able to run this:

Java ME - the Most Ubiquitous Application Platform for Mobile Devices

I think this can serve both as good and bad example.

Share:
42,149

Related videos on Youtube

sohilv
Author by

sohilv

Updated on July 08, 2022

Comments

  • sohilv
    sohilv almost 2 years

    More and more mobile platforms are being launched and sdk's are available to developers. There are various mobile platform are available: Android, iOS, Moblin, Windows mobile 7, RIM, symbian, bada, maemo etc.

    And making of cross platform application is headache for developers. I am searching for common things across the platforms which will help to developers who want to port application to all platforms. Like what are the diff screen resolutions, input methods, open gl support etc. please share details that you know for the any of platform.

    Or are there possibilities, by writing code in html (widget type of thing) and loading it into native application. I know about the android, in which we can add the web view into application by calling setContentView(view)

    Please share the class details where we can add the html view into native application of different type of platforms that you know.

    Purpose of this thread is share common details across developers. marking as community wiki.

    Cross platform tools & library

  • schoetbi
    schoetbi almost 14 years
    Well less (unnecessary) work for the developers means faster update cycles, faster new features, faster bugfixes and so on. With the same manpower more can be achived. I consider this as a benefit for the end user.
  • TechZen
    TechZen almost 14 years
    In theory, faster development might be better for the end user but that is not the philosophical underpinnings most cross-platform APIs. I have seen many attempts to use such tools in many environments and the focus is always on making the developer's life easier at the expense of the quality of the final product. Moreover, the promise of faster and cheaper seldom pans out. There always seems to be show stopping hitch somewhere that eats most of the time saved.
  • TechZen
    TechZen almost 14 years
    To drive my point home, consider this: Cross-platform APIs exist for many different classes of hardware and OS. How many cross-platform apps do you personally use on a regular basis? How many cross-platform apps have you ever used that you thought well of? People have been pushing cross-platform APIs since their has been more than one platform but they have never really succeeded anywhere. They don't succeed because they don't produce the most useful apps for the end users.
  • southerton
    southerton almost 14 years
    "How many cross-platform apps have you ever used that you thought well of?" - Google Earth
  • Youval Bronicki
    Youval Bronicki over 13 years
    Web applications are inherently cross platform, and at least on the desktop side they seem to be quite popular. Isn't this a question of maturity?
  • Alaa Nassef
    Alaa Nassef about 13 years
    Actually, there is no java on the iPhone, and as far as I know, java me doesn't run on android
  • TechZen
    TechZen about 13 years
    @Youval Bronicki -- (1) No web apps match the speed, resource use and UI of native apps. They are obvious second rate apps. (2) People like web apps precisely because they free them from hardware dependency i.e. the users do "a specific need to run the app on many different platforms" People accept the compromises of web apps so that they can access them from any available hardware. However, if you as a user only have one type of mobile device, the fact the developer can release for many other platforms gives you very little.
  • Youval Bronicki
    Youval Bronicki about 13 years
    I'm not sure I buy it. You are correct in theory. In practice, as the web platform matures, the benefits of native apps (for some applications) becomes less significant, and at some stage going native is just not worth the hassle).
  • TechZen
    TechZen about 13 years
    @Youval Bronicki -- People have been making that argument for nearly 30 years and the point at which cross-platform will trump platform specific is always "any day now," but the day never comes. The real hitch arises in the implied antecedent of "at some stage going native is just not worth the hassle." Not worth the hassle for whom? Users have always seemed to think it worth the developers hassle to develop platform specific and they neither know nor care how that benefits the developer.
  • Youval Bronicki
    Youval Bronicki about 13 years
    @TechZen -- I'm using StackOverflow now on my web browser and don't see any reason to look for a native client. I think you over generalize your claims.
  • TechZen
    TechZen about 13 years
    @Youval Bronicki -- The web browser you are using is a cross platform app that can be installed on two or more different operating systems? I haven't heard of one that does that besides a couple of Java experiments. FireFox, for example, is compiled separately for every OS and the same compile cannot be used on another OS. There is a significant difference between cross-platform code and a open standard like html, css etc.
  • Youval Bronicki
    Youval Bronicki about 13 years
    @TechZen - Thanks for clarifying our difference. I see web applications as the (currently) prime example of cross-platform applications. Of course the browser itself is not cross-platform (the browser's platform specific code is what allows web applications to be cross platform).
  • Vitaly
    Vitaly almost 13 years
    @TechZen - maybe most mobile crossplaform solutions are not mature enough yet, but it's only a matter of time. I'm sure before you someone said the same thing about crossplatform desktop applications. For crossplatform mobile game development Corona SDK is probably the best choice at the moment. For other things Sencha Touch + Phone Gap is a winning combo, IMO.
  • TechZen
    TechZen almost 13 years
    @Vitaly -- It's not "just a matter of time". Cross-plat has the wrong philisophical focus and you will never get the same performance ever as hardware specific APIs. Performance is always a moving target and cross-plat has to make tradeoffs that means it will never be as good as hardware specific. Ever.
  • kizzx2
    kizzx2 over 12 years
    I am quite upset that this sort of subjective philosophical debate gets the correct mark on a technical Web site. What's worse, this post's thesis is invalid for most major software we use today: Web browsers are cross-platform; Photoshop, MS Office, Dropbox and stuffs are cross platform; just open your Start menu or Finder and list out the platform specific guys -- chances are most turn out to be find small utility-ware. Your argument would be valid if you believe mobile phones are radically different (a highly valid assumption), but there seems to be no arguments to build that foundation.
  • kizzx2
    kizzx2 over 12 years
    Basically, it's along the same lines of saying "standard programming languages have the wrong philosophical focus and you will never get the same performance ever as architecture specific instruction sets by hand rolled assembly."
  • TechZen
    TechZen over 12 years
    @kizzx2 -- You need to reread my previous comments as I already addressed all your assertions. The answer was somewhat subjective because the question was somewhat subjective. Today, it would have been moved to one of the other overflow sites.
  • johnny
    johnny over 12 years
    "never get the same performance ever as hardware specific APIs" never is a long time.
  • Nick Garvey
    Nick Garvey about 12 years
  • Pascalius
    Pascalius over 11 years
    From my personal experience with cross compilers I can say that a cross compiler can boost quality and update cycles considerably for end users. However, they won't make life just easier for developers but are a big challenge as well.
  • Dongle
    Dongle over 10 years
    I see people supporting cross-platform here. This is the problem when web developers trying to enter to mobile market. That simply means "I do it even I don't know it, and I don't care too". Trying to integrate HTML and JavaScript to everything you can find is going to be a big problem. These so called developers claim how "quality" their apps are, even the Google and Apple recommends using native development, and more even IOS 7 has some limitations to cross platform. One day, these people will even claim they can create Robots with HTML. What a mess!
  • Quazi Irfan
    Quazi Irfan over 9 years
    I don't konw the details, but Avian JVM allows java to run on iOS devices.
  • Radmation
    Radmation almost 8 years
    I simply want to say that everything you stated is true - but I think developers know this - and given real world constraints (time-budgets-ect..) often times our hands are tied when it comes time to select the "best" choice for development. Cross-platform development definitely has a place and sure there are some drawbacks, but there are also gains as with anything.