Opentopia Directory Encyclopedia Tools

Cross-platform

Encyclopedia : C : CR : CRO : Cross-platform



 

A cross-platform (or platform independent) software application or hardware device works on multiple system platforms (e.g. Linux/Unix, Microsoft Windows, and Mac OS X). This may mean supporting all common platforms, or simply more than one.

Software and firmware are dependent on the functionality that each platform provides, as well as the programming language that each platform supports. In the early days of software development, cross-platform development was hindered by the fact that the functionality and language availability varied greatly across platforms. Today, many programming languages (such as C) are universally supported by the most common system platforms. Moreover, developers can expect nearly all platforms to support a wide range of functionality, from disk and file access to graphical user interfaces (GUIs) and network services.

Developers must access these features using the platform's application programming interfaces (APIs). Though some APIs (such as OpenGL or Berkeley sockets) are available on multiple platforms, many features are accessed using platform-specific frameworks (such as the Microsoft Foundation Classes). Cross-platform frameworks such as Java attempt to hide these platform-specific APIs by wrapping them in platform-neutral programming interfaces, allowing developers to create truly cross-platform software by building on top of these frameworks. However, not all of these frameworks are equally suited for building cross-platform software, since some frameworks may offer only partial support for certain features on some platforms.

Platform independent software

Software code not using any platform specific feature is inherently compatible across platforms. For example, the quicksort algorithm can be implemented without relying on special platform-dependent features.

Web applications

Web applications are normally considered cross-platform by definition, since they are interpreted by a web browser and do not use platform-specific features directly. Developing rich web applications often requires using advanced features such as Cascading Style Sheets and JavaScript. Many of these technologies have become Web standards, so theoretically any web application written to these standards will behave uniformly in any recent web browser, regardless of the underlying platform. Unfortunately, in practice web browsers often have incomplete or buggy implementations of these standards, and the same web browser may even behave slightly differently across platforms. These problems are often solved by writing browser- or platform-specific code, or by using non-standard APIs which future browsers may or may not support. Alternatively, they can be avoided by only using the features that all major browsers support.

Likewise, web applications may rely on content that not all browsers can render, such as Macromedia Flash presentations. These applications can be made cross-platform by including alternative content, such as images or MPEG-2 movies, that can be rendered as a placeholder.

Cross-platform web accessibility requires as much an understanding of users as of technical standards if a page is to be accessible on platforms as varied as screen readers, Braille-based web browsers, and small devices like mobile phones and PDAs.

Standard applications

Though Web applications have become more popular in recent years, most traditional applications are stored on the user's hard drive and executed locally. Such applications are stored in a machine-specific binary executable, which invoke the API specific to the user's operating system. Such executables are inherently tied to the platform that they are created for, and often cannot be used directly on another platform.

There are several basic approaches to avoiding this problem. First, the application can be developed using a technique known as abstraction. This technique involves writing as much as the application as possible without relying on platform-specific APIs. The parts that must be written using platform-specific APIs are cleanly separated from the rest of the application code, and are rewritten for each platform that the application will be deployed on. Though the resulting application is not completely platform independent, the task of deploying the application on a new platform is greatly simplified; developers must only augment the platform-specific portion of the code in order to handle the new platform.

Alternatively, the application in question can be written using a platform independent toolkit. Such toolkits provide developers with a consistent API that is independent of the underlying platform. One well-known example of this approach is the Opera Web browser, which uses the Qt toolkit to achieve compatibility across many operating systems. Other popular cross-platform toolkits include wxWidgets and GTK+.

However, neither of these two approaches allows the same executables to run on different platforms: instead, they facilitate creating different executables which behave uniformly. True cross-platform compatibility can be achieved using scripting languages. Programs written using scripting languages are not distributed as executable programs. Rather, these applications are distributed in source code form (or an obfuscated version thereof), and are translated into platform-specific executable code when the application is run. Virtual machines are similar in concept but take a slightly different technical tack. Virtual machines allow developers to translate their applications into a uniform, and often artificial, executable format during development; these executables are then further translated into each machine's specific executable format at run time. Popular virtual machine platforms include Sun's Java virtual machine and Microsoft's .NET framework.

It is worth noting that many cross-platform applications use a hybrid of these techniques. For example, the Mozilla Firefox Web browser was developed to run on many varied platforms using a combination of abstraction, platform-independent toolkits such as XUL, and the JavaScript scripting language.

Cross-platform guidelines

It is not easy to code these binary executables cross-platform since there are many small and some complex differences between platforms which have to be carefully taken care of. Therefore for cross-platform development cross-platform guidelines are needed. A guide for well-designed cross-platform development is wyoGuide.

Criticisms of cross-platform development

There are certain issues associated with cross-platform development. The most important of these include:

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.


Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: