Revision as of 13:48, 28 January 2014 editCodename Lisa (talk | contribs)55,077 edits →Design strategies: Consolidated two similar techniques into one strategy. Removed curely quotes per WP:MOS. (I could convert them to straight quotes but who is being quoted here?) Added source.← Previous edit | Latest revision as of 04:14, 23 November 2024 edit undoUzume (talk | contribs)Extended confirmed users, Page movers, Template editors11,552 edits →Toolkits and environments: +Q131308722 | ||
(625 intermediate revisions by more than 100 users not shown) | |||
Line 1: | Line 1: | ||
{{short description|Computer software implemented on multiple computing platforms}} | |||
{{For|a type of interchange between different lines in a metro system|cross-platform interchange}} | |||
{{Redirect|Cross-platform|the railway station interchange|cross-platform interchange|the video game term|cross-platform play}} | |||
{{Multiple issues | |||
{{Redirect|Multi-platform|the mode of storytelling in television|multi-platform television}} | |||
| refimprove=July 2009 | |||
In ], '''cross-platform software''' (also called '''multi-platform software''', '''platform-agnostic software''', or '''platform-independent software''') is ] that is designed to work in several ].<ref name="Sun-Web-00">{{cite web|url=http://java.sun.com/products/jlf/ed1/dg/higq.htm|title=Design Guidelines: Glossary|access-date=2011-10-19|publisher=java.sun.com|archive-url=https://web.archive.org/web/20120213051244/http://java.sun.com/products/jlf/ed1/dg/higq.htm |archive-date=2012-02-13 }}</ref> Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an ] or compiled to portable ] for which the ] or run-time packages are common or standard components of all supported platforms.<ref name="pcmag_cross_platform">{{cite web|title=SDD Technology blog: Definition of cross platform|url=https://www.sdd-technology.com/news/definition-of-cross-platform|access-date=2020-10-18|publisher=SDD Technology}}</ref> | |||
| cleanup=February 2010 | |||
| No footnotes=August 2010 | |||
}} | |||
For example, a cross-platform ] may run on ], ] and ]. Cross-platform software may run on many platforms, or as few as two. Some frameworks for cross-platform development are ], ArkUI-X, ], ], ], ], ], ], ], ], and ].<ref>{{cite web|url=https://www.codeproject.com/articles/1079101/xamarin-vs-ionic-a-mobile-cross-platform-shootout|title=Xamarin vs Ionic: A Mobile, Cross Platform, Shootout|author=Lee P Richardson|date=2016-02-16}}</ref> | |||
In ], '''cross-platform''', or '''multi-platform''', is an attribute conferred to ] or computing methods and concepts that are implemented and inter-operate on multiple ]s.<ref name="Sun-Web-00">{{cite web|url=http://java.sun.com/products/jlf/ed1/dg/higq.htm|title=Design Guidelines: Glossary|accessdate=2011-10-19|publisher=java.sun.com}}</ref> Cross-platform software may be divided into two types; one requires individual building or compilation for each platform that it supports, and the other one can be directly run on any platform without special preparation, e.g., software written in an ] or pre-compiled portable ] for which the interpreters or run-time packages are common or standard components of all platforms.<ref name="pcmag_cross_platform">{{cite web|url=http://www.pcmag.com/encyclopedia_term/0,2542,t=cross+platform&i=40495,00.asp#fbid=aHfb3ldkqPq | title=Encyclopedia > cross platform | accessdate=2011-10-19 | publisher=PC MAgazine Encyclopedia}}</ref> | |||
For example, a cross-platform ] may run on ] on the ], ] on the x86 architecture and ] on either the ] or ] based ] systems. A cross-platform ] may run on as many as all existing platforms, or on as few as two platforms. | |||
==Platforms== | ==Platforms== | ||
{{Main| |
{{Main|Computing platform}} | ||
''Platform'' can refer to the type of processor (CPU) or other hardware on which an ] (OS) or ] runs, the type of OS, or a combination of the two.<ref name="The Linux Information Project">{{cite web|url=http://www.linfo.org/platform.html|title=Platform Definition|access-date=2014-03-27|publisher=The Linux Information Project}}</ref> An example of a common platform is ] which runs on the ]. Other well-known platforms are ]/], ] and ], these are all cross-platform.<ref name="The Linux Information Project" /> Applications can be written to depend on the features of a particular platform—either the hardware, OS, or ] (VM) it runs on. For example, the ] is a common VM platform which runs on many OSs and hardware types. | |||
===Hardware <span class="anchor" id="Hardware platforms"></span>=== | |||
A hardware platform can refer to an ]. For example: ARM or the x86 architecture. These machines can run different operating systems. | |||
Smartphones and tablets generally run ARM architecture, these often run Android or iOS and other ]s. | |||
===Hardware platforms=== | |||
A hardware platform can refer to a ] or ]. For example: ] and its variants such as ] and ]. These machines often run one version of ],<ref name="Net Marketshare">, Windows (all variants) has ~ 89% market share as of March 2011</ref> though they can run other ]s as well, including ], ], ], ] and ]. | |||
===Software <span class="anchor" id="Software platforms"></span>=== | |||
An ] is common on ]s and ]s, which run ], ] and other ]s. | |||
A ] can be either an ] (OS) or ], though more commonly it is a combination of both. An exception is ], which uses an OS-independent ] (VM) to execute ]. Some software platforms are: | |||
* ] (ARM64) | |||
===Software platforms=== | |||
* ] (ARM32, ARM64, IA-32, x86-64) | |||
]s can either be an ] or ], though more commonly it is a combination of both. A notable exception to this is ], which uses an operating system independent ] for its ] code, known in the world of Java as ]. Examples of software platforms include: | |||
* ] (CLI) by ], implemented in: | |||
* ] for ]s and ]s | |||
** The legacy ] that works only on Microsoft Windows. | |||
* ] (]), ] (PowerPC), ] (x86, PowerPC, m68k), ] (PowerPC) | |||
** The newer ] framework (simply called ".NET") that works across Microsoft Windows, macOS, and Linux. | |||
* ] (Many platforms; see ], for example) | |||
** Other implementations such as ] (formerly by ] and ]<ref name="Mono_by_Xamarin">{{cite web |title=About Mono |url=http://www.mono-project.com/docs/about-mono/ |access-date=2015-12-17 |publisher=mono-project.com}}</ref>) | |||
* ] (ARM64, RISC-V, x86, x64, and LoongArch) | |||
* ] ((ARMv8-A)) | |||
* ] (ARMv8-A) | |||
* ] | * ] | ||
* ] ( Alpha, ARC, ARM, C-Sky, Hexagon, LoongArch, m68k, Microblaze, MIPS, Nios II, OpenRISC, PA-RISC, PowerPC, RISC-V, s390, SuperH, SPARC, x86, Xtensa) | |||
* ] (x86, PowerPC, and other architectures) | |||
* ] |
* ] x86, ARM (Apple silicon) | ||
* ] (x86, |
* ] (IA-32, x86-64, ARM, ARM64) | ||
* ] (x86), PlayStation 3 (PowerPC) and ] (ARM) | |||
* ]-type systems on the x86: ], ], ], ] | |||
* ] (SPARC, x86) | |||
* ] | |||
* ] (many platforms since 1969) | |||
* ]s – mostly compatible with each other, running ] web-apps | |||
* ] | |||
;Minor, historical | |||
* AmigaOS (m68k), ] (PowerPC), ] (x86, PowerPC, m68k), MorphOS (PowerPC) | |||
* ], ] | |||
* ] (many platforms; see NetBSDnet,{{Clarify|reason=|date=July 2018}} for example) | |||
* ]-type systems on the x86: ], ], ], ] | |||
* ], ] | * ], ] | ||
* ] ( |
* ] (PowerPC, x86) | ||
* The ], also known by the implementation names ] (from ]) and ] (from ]) | |||
====Java platform==== | ==== Java <span class="anchor" id="Java platform"></span> ==== | ||
{{Main|Java platform}} | {{Main|Java (software platform)}} | ||
The ] is typically compiled to run on a VM that is part of the Java platform. The ] (Java VM, JVM) is a CPU implemented in software, which runs all Java code. This enables the same code to run on all systems that implement a JVM. Java software can be executed by a hardware-based ]. This is used mostly in embedded systems. | |||
Java code running in the JVM has access to OS-related services, like disk ] (I/O) and network access, if the appropriate privileges are granted. The JVM makes the system calls on behalf of the Java application. This lets users to decide the appropriate protection level, depending on an ] (ACL). For example, disk and network access is usually enabled for desktop applications, but not for browser-based ]s. The ] (JNI) can also be used to access OS-specific functions, with a loss of portability. | |||
Currently, Java Standard Edition software can run on Microsoft Windows, macOS, several Unix-like OSs, and several ]s for embedded devices. For mobile applications, browser plugins are used for Windows and Mac based devices, and Android has built-in support for Java. There are also subsets of Java, such as ] or ], designed for resource-constrained devices. | |||
== Implementation <span class="anchor" id="Implementations"></span> == | |||
==Cross-platform software== | |||
For |
For software to be considered cross-platform, it must function on more than one ] or OS. Developing such software can be a time-consuming task because different OSs have different ] (API). | ||
Software written for one OS may not automatically work on all architectures that OS supports. Just because software is written in a popular ] such as ] or ], it does not mean it will run on all OSs that support that language—or even on different versions of the same OS. | |||
===Web applications=== | ===Web applications=== | ||
]s are typically described as cross-platform because, ideally, they are accessible from any |
]s are typically described as cross-platform because, ideally, they are accessible from any ]: the browser is the platform. Web applications generally employ a ], but vary widely in complexity and functionality. It can be hard to reconcile the desire for features with the need for compatibility. | ||
Basic web applications perform all or most processing from a ], and pass the result to the client web browser. All user interaction with the application consists of simple exchanges of data requests and server responses. |
Basic web applications perform all or most processing from a ], and pass the result to the client web browser. All user interaction with the application consists of simple exchanges of data requests and server responses. This type of application was the norm in the early phases of ] application development. Such applications follow a simple ] model, identical to that of serving ]s. Today, they are still relatively common, especially where cross-platform compatibility and simplicity are deemed more critical than advanced functionality. | ||
Prominent examples of advanced web applications include the Web interface to ] |
Prominent examples of advanced web applications include the Web interface to ] and ]. Such applications routinely depend on additional features found only in the more recent versions of popular web browsers. These features include ], ], ], ], and other components of ]. | ||
====Design strategies==== | ==== Design <span class="anchor" id="Design strategies"></span> ==== | ||
Because of the competing interests of |
Because of the competing interests of compatibility and functionality, numerous design strategies have emerged. | ||
;Graceful degradation: | |||
Graceful degradation attempts to provide the same or similar functionality to all users and platforms, while diminishing that functionality to a least common denominator for more limited client browsers. For example, a user attempting to use a limited-feature browser to access Gmail may notice that Gmail switches to basic mode, with reduced functionality. Some{{who|date=August 2013}} view this strategy as a lesser form of cross-platform capability. | |||
;Single codebase: | |||
This strategy relies on having one codebase that may be compiled to multiple platform-specific formats. One technique is ]. With this technique, code that is common to all platforms is not repeated. Blocks of code that are only relevant to certain platforms are made conditional, so that they are only ] or ] when needed. Another technique is separation of functionality, which attempts disables functionality not supported by client browsers or operating systems, while still delivering a complete application to the user. (See also: ]). This technique is used in web development where interpreted code (as in scripting languages) can query the platform it is running on to execute different blocks conditionally.<ref>{{cite journal|last=Corti|first=Sascha P.|title=Browser and Feature Detection|journal=MSDN Magazine|date=October 2011|url=http://msdn.microsoft.com/en-us/magazine/hh475813.aspx|accessdate=28 January 2014}}</ref> | |||
;Multiple codebases: | |||
Multiple codebase applications maintain distinct codebases for different (hardware and OS) platforms, with equivalent functionality. This obviously requires a duplication of effort in maintaining the code, but can be worthwhile where the amount of platform-specific code is high. | |||
;Third-party libraries: | |||
Third-party libraries attempt to simplify cross-platform capability by hiding the complexities of client differentiation behind a single, unified API. | |||
;Responsive Web design: | |||
] (RWD) is a Web design approach aimed at crafting sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from mobile phones to desktop computer monitors). | |||
Many software systems use a layered architecture where platform-dependent code is restricted to the upper- and lowermost layers. | |||
====Testing strategies==== | |||
One complicated aspect of cross-platform web application design is the need for ]. In addition to the complications mentioned previously, there is the additional restriction that some web browsers prohibit installation of different versions of the same browser on the same operating system. Techniques such as ] are sometimes used as a workaround for this problem. | |||
=====Graceful degradation===== | |||
Graceful degradation attempts to provide the same or similar functionality to all users and platforms, while diminishing that functionality to a least common denominator for more limited client browsers. For example, a user attempting to use a limited-feature browser to access Gmail may notice that Gmail switches to basic mode, with reduced functionality but still of use. | |||
=====Multiple codebases===== | |||
Some software is maintained in distinct codebases for different (hardware and OS) platforms, with equivalent functionality. This requires more effort to maintain the code, but can be worthwhile where the amount of platform-specific code is high. | |||
=====Single codebase===== | |||
This strategy relies on having one codebase that may be compiled to multiple platform-specific formats. One technique is ]. With this technique, code that is common to all platforms is not repeated. Blocks of code that are only relevant to certain platforms are made conditional, so that they are only ] or ] when needed. Another technique is separation of functionality, which disables functionality not supported by browsers or OSs, while still delivering a complete application to the user. (See also: ].) This technique is used in web development where interpreted code (as in scripting languages) can query the platform it is running on to execute different blocks conditionally.<ref>{{cite journal|last=Corti|first=Sascha P.|title=Browser and Feature Detection|journal=MSDN Magazine|date=October 2011|url=http://msdn.microsoft.com/en-us/magazine/hh475813.aspx|access-date=28 January 2014}}</ref> | |||
=====Third-party libraries===== | |||
Third-party libraries attempt to simplify cross-platform capability by hiding the complexities of client differentiation behind a single, unified API, at the expense of ]. | |||
=====Responsive web design===== | |||
] (RWD) is a Web design approach aimed at crafting the visual layout of sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices, from mobile phones to desktop computer monitors. Little or no platform-specific code is used with this technique. | |||
==== Testing <span class="anchor" id="Testing strategies"></span>==== | |||
Cross-platform applications need much more ]. Some web browsers prohibit installation of different versions on the same machine. There are several approaches used to target multiple platforms, but all of them result in software that requires substantial manual effort for testing and maintenance.<ref>{{Cite book|last=Choudhary|first=S.R.|title=Companion Proceedings of the 36th International Conference on Software Engineering |chapter=Cross-platform testing and maintenance of web and mobile applications |date=2014|pages=642–645|doi=10.1145/2591062.2591097|isbn=9781450327688|s2cid=1903037|hdl=1853/53588|hdl-access=free |url=https://repository.gatech.edu/server/api/core/bitstreams/c283fd1a-551d-4b0e-a7da-7add80df2328/content }}</ref> Techniques such as ] are sometimes used as a workaround for this problem. | |||
Tools such as the Page Object Model allow cross-platform tests to be scripted so that one test case covers multiple versions of an app. If different versions have similar user interfaces, all can be tested with one test case. | |||
===Traditional applications=== | ===Traditional applications=== | ||
Web applications are becoming increasingly popular but many computer users still use traditional application software which does not rely on a client/web-server architecture. The distinction between traditional and web applications is not always clear. Features, installation methods and architectures for web and traditional applications overlap and blur the distinction. Nevertheless, this simplifying distinction is a common and useful generalization. | |||
====Binary software==== | ====Binary software==== | ||
Traditional application software has been distributed as binary files, especially ]s. Executables only support the platform they were built for—which means that a single cross-platform executable could be very bloated with code that never executes on a particular platform. Instead, generally there is a selection of executables, each built for one platform. | |||
For software that is distributed as a binary executable, such as |
For software that is distributed as a binary executable, such as that written in C or C++, there must be a ] for each platform, using a toolset that translates—transcompiles—a single codebase into multiple binary executables. For example, ], an open-source web browser, is available on Windows, macOS (both ] and x86 through what ] calls a ]), Linux, and BSD on multiple computer architectures. The four platforms (in this case, Windows, macOS, Linux, and BSD) are separate executable distributions, although they come largely from the same ]. In rare cases, executable code built for several platforms is combined into a single executable file called a ]. | ||
The use of different toolsets |
The use of different toolsets may not be enough to build a working executables for different platforms. In this case, programmers must '']'' the source code to the new platform. For example, an application such as Firefox, which already runs on Windows on the x86 family, can be modified and re-built to run on Linux on the x86 (and potentially other architectures) as well. The multiple versions of the code may be stored as separate codebases, or merged into one codebase. | ||
porting must be accompanied by cross-platform building, the reverse is not the case. | |||
An alternative to porting is '']'', where applications compiled for one platform can run on another without modification of the source code or binaries. As an example, Apple's ], which is built into ]-based Macintosh computers, runs applications compiled for the previous generation of Macs that used PowerPC CPUs. Another example is IBM ], which allows Linux/x86 applications to run unmodified on the Linux/Power OS. | |||
Example of cross-platform binary software: | |||
* The ] office suite is built for Microsoft Windows, macOS, Linux, ], ], ], ], ], ], ], web-based ] and many others.<ref>{{Cite news|last=Mehrotra|first=Pranob|date=2020-12-01|title=Collabora Office suite gets a new layout for Android tablets and Chromebooks|work=XDA-Developers|url=https://www.xda-developers.com/collabora-office-suite-gets-layout-android-tablets-chromebooks/|access-date=2021-01-15|quote=Collabora Office is a popular open-source alternative to the Microsoft Office suite. It's based on LibreOffice, and it's available on a variety of platforms, including Windows, Linux, iOS, and Android. This year in July, a major update for the office suite brought support for Chrome OS devices.}}</ref><ref name=":1">{{Cite news|last=|first=|date=2020-12-15|title=Collabora Office on iOS and Android Just got Better!|work=Adfinis|url=https://adfinis.com/en/blog/collabora-office-on-ios-and-android-just-got-better/|access-date=2021-01-15|quote=...touch optimized interfaces: one for tablets and one for phone screens. ...(iOS, iPadOS, Chromebooks, Android).}}</ref> Many of these are supported on several hardware platforms with processor architectures including ], ], ] (ARMel, ARMhf, ARM64), ], ], ], ], and S390x<ref>{{Cite news|date=2021-03-26|title=Nextcloud Ubuntu Appliance adds Collabora Online to Raspberry Pi image|work=MuyLinux|url=https://www.muylinux.com/2021/03/26/nextcloud-ubuntu-appliance-collabora-online-raspberry-pi/|access-date=2021-03-30|quote=the first viable self-hosted web office solution for the popular Raspberry Pi 4 platform}}</ref> | |||
====Scripts and interpreted languages==== | ====Scripts and interpreted languages==== | ||
A script can be considered to be cross-platform if its ] is available on multiple platforms and the script only uses the facilities |
A script can be considered to be cross-platform if its ] is available on multiple platforms and the script only uses the facilities built into the language. For example, a script written in ] for a ] system will likely run with little or no modification on Windows, because Python also runs on Windows; indeed there are many implementations (e.g. ] for ]). The same goes for many of the ] ]. | ||
Unlike binary executable files, the same script can be used on all computers that have software to interpret the script. This is because the script is generally stored in ] in a ]. There may be some issues |
Unlike binary executable files, the same script can be used on all computers that have software to interpret the script. This is because the script is generally stored in ] in a ]. There may be some trivial issues, such as the representation of a ]. | ||
Some |
Some popular cross-platform scripting languages are: | ||
* ] – A ] commonly run on ] and other modern Unix-like systems, as well as on Windows via the ] ] compatibility layer. | |||
* ] – A ] commonly run on Linux and other modern Unix-like systems, as well as on Windows via the ] ] compatibility layer, ] for Windows, or the ]. | |||
* ] – A ] first released in 1987. Used for ] ] programming, small ] tasks, and more. | |||
* ] – First released in 1987. Used for ] programming, small ] tasks, and more. | |||
* ] – A ] most popular in use for web applications. | |||
* ] – Mostly used for web applications. | |||
* ] – A modern ] where the focus is on ] and ease-of-writing, instead of program run-time efficiency. | |||
* ] – A |
* ] – A language which focuses on ] and ease of writing, instead of run-time efficiency. | ||
* ] – An object-oriented language which aims to be easy to read. Can also be used on the web through ]. | |||
* ] – A dynamic programming language, suitable for a wide range of uses, including web and desktop applications, networking, administration, testing and many more. | * ] – A dynamic programming language, suitable for a wide range of uses, including web and desktop applications, networking, administration, testing and many more. | ||
===Video games=== | ===Video games=== | ||
Cross-platform is a term that can also apply to ]s released on a range of ]s |
Cross-platform or multi-platform is a term that can also apply to ]s released on a range of ]s. Examples of cross-platform games include: '']'', '']'', '']'', '']'' and '']''. | ||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
Each has been released across a variety of gaming platforms, such as the ], ], ], ]s |
Each has been released across a variety of gaming platforms, such as the ], ], ], ]s, and ]. | ||
Some platforms are harder to write for than others, requiring more time to develop the video game to the same standard. To offset this, a video game may be released on a few platforms first, then later on others. Typically, this happens when a new gaming system is released, because ]s need to acquaint themselves with its hardware and software. | |||
Some games may not |
Some games may not be cross-platform because of licensing agreements between developers and video game console manufacturers that limit development to one particular console. As an example, ] could create a game with the intention of release on the latest ] and ] game consoles. Should Disney license the game with Sony first, it may be required to release the game solely on Sony's console for a short time ]. | ||
====Cross-platform play==== | |||
Several developers have implemented means to play games online while using different platforms. ], ], and ] all possess technology that allows ] and ] gamers to play with PC gamers, leaving the decision of which platform to use to consumers. The first game to allow this level of interactivity between PC and console games was '']''.{{Citation needed|date=October 2008}} | |||
{{Main|Cross-platform play|List of video games that support cross-platform play}} | |||
Several developers have implemented ways to play games online while using different platforms. ], ], ], and ] all possess technology that allows Xbox 360 and PlayStation 3 gamers to play with PC gamers, leaving the decision of which platform to use to consumers. The first game to allow this level of interactivity between PC and console games (Dreamcast with specially produced keyboard and mouse) was '']''.<ref>Cribba. , ''Giant Bombcast'', February 15, 2013.</ref><ref></ref> | |||
Games that feature cross-platform ] include '']'', '']'', '']'', '']'', '']'' and ''],'' and '']'' with its Better Together update on ], VR editions, ] and ]. | |||
Games that feature cross-platform online play include: | |||
* '']''{{Citation needed|date=July 2011}} | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']'' | |||
* '']''<ref>{{cite web | url = http://www.youtube.com/watch?v=CeKeLDfj-hE&feature=channel_video_title | title = Team Fortress 2 Now available on OS X | publisher = ] }}</ref> | |||
* '']''<ref name="http://www.eurogamer.net/articles/2011-01-18-portal-2-ps3-steam-cross-platform-play">{{cite web | url=http://www.eurogamer.net/articles/2011-01-18-portal-2-ps3-steam-cross-platform-play | title=Portal 2 PC/PS3 Cross-platform | publisher=Eurogamer | accessdate=January 24, 2012}}</ref> | |||
* '']'' with '']'' | |||
* '']'' | |||
==Cross-platform programming== | ==Programming <span class="anchor" id="Cross-platform programming"></span> == | ||
Cross-platform programming is the practice of |
Cross-platform programming is the practice of deliberately writing software to work on more than one platform. | ||
===Approaches to cross-platform programming=== | ===Approaches <span class="anchor" id="Approaches to cross-platform programming"></span> === | ||
There are different ways |
There are different ways to write a cross-platform application. One approach is to create multiple versions of the same software in different ''source trees''—in other words, the Microsoft Windows version of an application might have one set of source code files and the ] version another, while a ] ] system might have a third. While this is straightforward, compared to developing for only one platform it can cost much more to pay a larger team or release products more slowly. It can also result in more bugs to be tracked and fixed. | ||
Another approach |
Another approach is to use software that hides the differences between the platforms. This ] insulates the application from the platform. Such applications are ''platform agnostic''. Applications that run on the JVM are built this way. | ||
Some applications mix various methods of cross-platform programming to create the final application. An example |
Some applications mix various methods of cross-platform programming to create the final application. An example is the Firefox web browser, which uses abstraction to build some of the lower-level components, with separate source subtrees for implementing platform-specific features (like the GUI), and the implementation of more than one scripting language to ease ]. Firefox implements ], ] and JavaScript for extending the browser, in addition to classic ]-style browser plugins. Much of the browser itself is written in XUL, CSS, and JavaScript. | ||
===Cross-platform programming toolkits and environments=== | ===Toolkits and environments<span class="anchor" id="Cross-platform programming toolkits and environments"></span>=== | ||
There are many tools<ref name="TheGUIToolkit"></ref><ref name="PlatformIndependentFAQ">{{cite web |url=http://www.zeta.org.au/~rosko/pigui.htm |title=Platform Independent FAQ |access-date=2009-04-25 |archive-url=https://web.archive.org/web/20080816180726/http://www.zeta.org.au/~rosko/pigui.htm |archive-date=2008-08-16 |url-status=dead }}</ref> available to help the process of cross-platform programming: | |||
{{example farm|date=March 2012}} | |||
There are a number of tools<ref name="TheGUIToolkit"></ref><ref name="PlatformIndependentFAQ"></ref> which are available to help facilitate the process of cross-platform programming: | |||
* ]: a development language which utilizes ] as its GUI layer. It currently supports Android, iOS, Windows, macOS, Linux and Raspberry Pi. | |||
* ]: A ] library used to provide a vector graphics-based, device-independent API. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is written in C and has bindings for many programming languages. | |||
* ]: A mobile application platform that works in all Indian languages, including their keyboards, and also supports AppWallet and native performance in all OSs. | |||
* ]: An open source cross-platform development environment. Implemented in Java with a configurable architecture which supports many tools for software development. Add-ons are available for several languages, including Java and C++. | |||
* ]: a framework that supports the workflow of app development and deployment in an enterprise environment. Natively developed containers present hardware features of the mobile devices or tablets through an API to HTML5 code thus facilitating the development of mobile apps that run on different platforms. | |||
* ]: Another open source cross platform toolkit, but more lightweight because it restricts itself to the GUI. | |||
* ]: a UI framework written in C++. | |||
* ]: An open source widget toolkit that is completely implemented in Object Pascal. It currently supports Linux, Windows and a bit of Windows CE. | |||
* ]: a ] library used to provide a vector graphics-based, device-independent API. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is written in C and has bindings for many programming languages. | |||
* ]: an open-source toolkit and game engine for developing 2D and simple 3D cross-platform games and applications. | |||
* ]: an open-source Write Once Run Anywhere (WORA) framework for Java and Kotlin developers. | |||
* ]: an IDE which uses a Pascal-based language for development. It supports Android, iOS, Windows, macOS, Linux. | |||
* ]: a GUI and 2D/3D graphics toolkit and IDE, written in eC and with support for additional languages such as C and Python. It supports Linux, FreeBSD, Windows, Android, macOS and the Web through Emscripten or {{wdrl|Q131308722}} (WebAssembly). | |||
* ]: an open-source development environment. Implemented in Java with a configurable architecture which supports many tools for software development. Add-ons are available for several languages, including Java and C++. | |||
* ]: an open-source toolkit, but more lightweight because it restricts itself to the GUI. | |||
* ]: A cross-platform UI framework for Android and iOS developed by ]. | |||
* ]: An open-source widget toolkit that is completely implemented in Object Pascal. It currently supports Linux, Windows and a bit of Windows CE. | |||
* ]: A Windows rapid software development solution for cross-platform application creation and deployment based on ] and supporting ], ], ] including Android and BlackBerry smart devices, ] for ] mobile devices, ], ], ], and ]. | * ]: A Windows rapid software development solution for cross-platform application creation and deployment based on ] and supporting ], ], ] including Android and BlackBerry smart devices, ] for ] mobile devices, ], ], ], and ]. | ||
* ]: A BASIC dialect and compiler that generates C++ code. It includes cross compilers for many platforms and supports numerous platform (Windows, Mac, Linux, Android, iOS and some exotic handhelds). | |||
* ]: An open source widget toolkit for Unix-like systems with X11 and Microsoft Windows. | |||
* ]: an SDK which uses Godot Engine. | |||
* ]: An open source cross-platform language. | |||
* ]: An |
* ]+: An open-source widget toolkit for Unix-like systems with X11 and Microsoft Windows. | ||
* ]: An open-source language. | |||
* ]: A ] that encapsulates platform-independent code with a platform-specific runtime environment into applications for Mac OS X and Windows. | |||
* ]: An application framework written in C++, used to write native software on numerous systems (Microsoft Windows, POSIX, macOS), with no change to the code. | |||
* ] (an open source version of ]): A cross-platform framework for applications and programming languages. | |||
* ]: an open-source cross-platform UI framework written in ]. It supports ], ], ], ], ] and ]. | |||
* ] is an open source ] design pattern where the model and controller are shared cross-platform but the view is platform-specific. | |||
* ]: Cross-platform SDK libraries to integrate recognition, document, medical, imaging, and multimedia technologies into Windows, iOS, macOS, Android, Linux and web applications.<ref>{{Cite web|title=Cross-Platform SDK Libraries for Recognition, Document, Medical, Imaging, and Multimedia|url=https://www.leadtools.com/sdk/cross-platform|access-date=2021-03-03|website=www.leadtools.com}}</ref> | |||
* ] is an open source SDK for mobile platform app development in the C++ family. | |||
* ]: a commercial cross-platform rapid application development language inspired by HyperTalk. | |||
* ]: An open source platform for building Mac OS X, Windows and Linux applications. | |||
* ]: A programming environment for the FreePascal Compiler. It supports the creation of self-standing graphical and console applications and runs on Linux, MacOSX, iOS, Android, WinCE, Windows and WEB. | |||
* ]: A cross-platform 3D graphics library. | |||
* ]: A ] that encapsulates platform-independent code with a platform-specific runtime environment into applications for macOS and Windows A cross-platform Android runtime. It allows unmodified Android apps to run natively on iOS and macOS | |||
* ]—An application framework and ] for ] systems with ], Microsoft Windows, Mac OS X, and other systems—available under both ] and proprietary licenses. | |||
* ]: a cloud-based low-code application development platform. | |||
* ]: a RAD IDE developed by Real Software, uses an object-oriented dialect of the BASIC programming language, and produces compiled binaries for Mac OS X, Windows and Linux, as wells as being able to produce cgi-based web applications. iOS support is currently in development. | |||
* ]: an open-source ] design pattern where the model and controller are cross-platform but the view is platform-specific.<ref>{{Cite web|url=https://headworks.io/blog/12-benefits-of-Xamarin-Cross-platform-app-development|title=12 benefits of Xamarin Cross-platform app development|date=15 Mar 2019|website=HeadWorks}}</ref> | |||
* Simple and Fast Multimedia Library—A multimedia C++ ] that provides low and high level access to graphics, input, audio, etc. | |||
* ]: An open-source cross-platform version of ] (a framework for applications and programming languages) | |||
* ]—An ] cross-platform multimedia library written in C that creates an abstraction over various platforms’ graphics, sound, and input ]. It runs on many operating systems including Linux, Windows and Mac OS X and is aimed at games and multimedia applications. | |||
* ]: an open-source SDK for mobile platform app development in the C++ family. | |||
* ]: A cross platform tool for Windows used to create mobile applications for J2ME, Symbian S60, BlackBerry and Android, using ] tools and action editing. | |||
* ]: an open-source platform for building macOS, Windows and Linux applications. | |||
* ] | |||
* ]: a 3D graphics library. | |||
* ]: is a C++ cross-platform rapid application development framework focused on programmers productivity. It includes a set of libraries (GUI, SQL, etc..), and an integrated development environment. It supports Windows and Unix-like OS-s. The U++ competes with popular scripting languages while preserving C/C++ runtime characteristics. It has its own integrated development environment, TheIDE, which features BLITZ-build technology to speedup C++ rebuilds up to 4 times. | |||
* ]: A proprietary 2D game development software for Windows for developing Windows and ] games. | |||
* ]: Integrated Development Environment for Internet and Intranet. | |||
* ]: |
* ]: a proprietary language and IDE for building macOS, Windows and Linux applications. | ||
* : The universal development SDK to build multi-platform projects with React Native. Includes latest iOS, tvOS, Android, Android TV, Web, Tizen TV, Tizen Watch, LG webOS, macOS/OSX, Windows, KaiOS, Firefox OS and Firefox TV platforms. | |||
* ]: Integrated Development Environment for Smartphones, Tablets and industrial terminals (Windows 8 RT, Windows CE, Windows Phone, iOS, Android). | |||
* ]: an application framework and ] for ] systems with ], Microsoft Windows, macOS, and other systems—available under both proprietary and ]s. | |||
* ]: An open source widget toolkit that is also an ].<ref name="wxwidgets"></ref> It runs on ] systems with ], Microsoft Windows and Mac OS X. It permits applications written to use it to run on all of the systems that it supports, if the application does not use any ]-specific programming in addition to it. | |||
* ]: A multimedia C++ ] that provides low and high level access to graphics, input, audio, etc. | |||
* ] is a cross-platform IDE for Windows, Linux, Mac OS X, and mobile operating systems. | |||
* ]: an open-source multimedia library written in C that creates an abstraction over various platforms' graphics, sound, and input ]. It runs on OSs including Linux, Windows and macOS and is aimed at games and multimedia applications. | |||
* ] IDE is a programming environment for the FreePascal Compiler. It supports the creation of self-standing graphical and console applications and runs on Linux, MacOSX, iOS, Android, WinCE, Windows and WEB. | |||
* ]: a native app development tool to create mobile applications for Android and iOS, using ] design editor with JavaScript code editor. | |||
* ]/] | |||
* ]: open source cross-platform framework for Android and iOS development. | |||
* ]: a C++ GUI framework for performance. It includes a set of libraries (GUI, SQL, etc..), and IDE. It supports Windows, macOS and Linux. | |||
* ]: Another cross-platform SDK which uses Unity Engine. | |||
* ]: Windows, macOS, iOS, Android, WebAssembly and Linux using C#. | |||
* ]: A cross-platform SDK which uses Unreal Engine. | |||
* ]: V-Play is a cross-platform development SDK based on the popular Qt framework. V-Play apps and games are created within Qt Creator. | |||
* ]: A low-code development tool to create responsive web and hybrid mobile (Android & iOS) applications. | |||
* ]: an Integrated Development Environment for Windows, Linux, .Net and Java, and web browers. Optimized for business and industrial applications. | |||
* ]: an open-source widget toolkit that is also an ].<ref name="wxwidgets"></ref> It runs on ] systems with ], Microsoft Windows and macOS. | |||
* ]: a RAD IDE that uses an object-oriented programming language to compile desktop, web and iOS apps. Xojo supports natively compiling to Windows, macOS, iOS and Linux, and can also create compiled web apps that are able to be run as standalone servers or through CGI. | |||
==Challenges <span class="anchor" id="Challenges to cross-platform development"></span>== | |||
There are many challenges when developing cross-platform software. | |||
==Challenges to cross-platform development== | |||
There are certain issues associated with cross-platform development. Some of these include: | |||
* Testing cross-platform applications may be considerably more complicated, since different platforms can exhibit slightly different behaviors or subtle bugs. This problem has led some developers to deride cross-platform development as "write once, debug everywhere", a take on ]' "]" marketing slogan. | * Testing cross-platform applications may be considerably more complicated, since different platforms can exhibit slightly different behaviors or subtle bugs. This problem has led some developers to deride cross-platform development as "write once, debug everywhere", a take on ]' "]" marketing slogan. | ||
* Developers are often restricted to using the ] subset of features which are available on all platforms. This may hinder the application's performance or prohibit developers from using |
* Developers are often restricted to using the ] subset of features which are available on all platforms. This may hinder the application's performance or prohibit developers from using the most advanced features of each platform. | ||
* Different platforms often have different user interface conventions, which cross-platform applications do not always accommodate. For example, applications developed for |
* Different platforms often have different user interface conventions, which cross-platform applications do not always accommodate. For example, applications developed for macOS and ] are supposed to place the most important button on the right-hand side of a window or dialog, whereas Microsoft Windows and ] have the opposite convention. Though many of these differences are subtle, a cross-platform application which does not conform to these conventions may feel clunky or alien to the user. When working quickly, such opposing conventions may even result in ], such as in a ] confirming whether to save or discard changes. | ||
* Scripting languages and |
* Scripting languages and VM bytecode must be translated into native executable code each time they are used, imposing a performance penalty. This penalty can be alleviated using techniques like ]; but some computational overhead may be unavoidable. | ||
* Different platforms require the use of native package formats such as ] and ]. Multi-platform installers such as ], ], ], or ] address this need. | * Different platforms require the use of native package formats such as ] and ]. Multi-platform installers such as ] address this need. | ||
* Cross-platform execution environments may suffer cross-platform security flaws, creating a fertile environment for cross-platform malware. | * Cross-platform execution environments may suffer cross-platform security flaws, creating a fertile environment for cross-platform malware.<ref>{{Cite web|url=https://www.theverge.com/2020/1/14/21065122/microsoft-windows-7-end-of-support-lifecycle-millions-pcs|title=Microsoft bids farewell to Windows 7 and the millions of PCs that still run it|last=Warren|first=Tom|date=2020-01-14|website=The Verge|language=en|access-date=2020-02-06}}</ref> | ||
==See also== | ==See also== | ||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
* ] | * ] | ||
* ] | * ] | ||
* ] | * ] | ||
* ] | * ] | ||
* ] | |||
* ] | |||
* ] | * ] | ||
* ] | |||
* ] | |||
* ]s, many of which are cross-platform. | |||
==References== | ==References== | ||
{{Reflist}} | |||
<references /> | |||
{{DEFAULTSORT:Cross-Platform}} | {{DEFAULTSORT:Cross-Platform}} | ||
] | |||
] | ] | ||
] |
Latest revision as of 04:14, 23 November 2024
Computer software implemented on multiple computing platforms "Cross-platform" redirects here. For the railway station interchange, see cross-platform interchange. For the video game term, see cross-platform play. "Multi-platform" redirects here. For the mode of storytelling in television, see multi-platform television.In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.
For example, a cross-platform application may run on Linux, macOS and Microsoft Windows. Cross-platform software may run on many platforms, or as few as two. Some frameworks for cross-platform development are Codename One, ArkUI-X, Kivy, Qt, GTK, Flutter, NativeScript, Xamarin, Apache Cordova, Ionic, and React Native.
Platforms
Main article: Computing platformPlatform can refer to the type of processor (CPU) or other hardware on which an operating system (OS) or application runs, the type of OS, or a combination of the two. An example of a common platform is Android which runs on the ARM architecture family. Other well-known platforms are Linux/Unix, macOS and Windows, these are all cross-platform. Applications can be written to depend on the features of a particular platform—either the hardware, OS, or virtual machine (VM) it runs on. For example, the Java platform is a common VM platform which runs on many OSs and hardware types.
Hardware
A hardware platform can refer to an instruction set architecture. For example: ARM or the x86 architecture. These machines can run different operating systems.
Smartphones and tablets generally run ARM architecture, these often run Android or iOS and other mobile operating systems.
Software
A software platform can be either an operating system (OS) or programming environment, though more commonly it is a combination of both. An exception is Java, which uses an OS-independent virtual machine (VM) to execute Java bytecode. Some software platforms are:
- Android (ARM64)
- ChromeOS (ARM32, ARM64, IA-32, x86-64)
- Common Language Infrastructure (CLI) by Microsoft, implemented in:
- The legacy .NET Framework that works only on Microsoft Windows.
- The newer .NET framework (simply called ".NET") that works across Microsoft Windows, macOS, and Linux.
- Other implementations such as Mono (formerly by Novell and Xamarin)
- HarmonyOS (ARM64, RISC-V, x86, x64, and LoongArch)
- iOS ((ARMv8-A))
- iPadOS (ARMv8-A)
- Java
- Linux ( Alpha, ARC, ARM, C-Sky, Hexagon, LoongArch, m68k, Microblaze, MIPS, Nios II, OpenRISC, PA-RISC, PowerPC, RISC-V, s390, SuperH, SPARC, x86, Xtensa)
- macOS x86, ARM (Apple silicon)
- Microsoft Windows (IA-32, x86-64, ARM, ARM64)
- PlayStation 4 (x86), PlayStation 3 (PowerPC) and PlayStation Vita (ARM)
- Solaris (SPARC, x86)
- SPARC
- Unix (many platforms since 1969)
- Web browsers – mostly compatible with each other, running JavaScript web-apps
- Xbox
- Minor, historical
- AmigaOS (m68k), AmigaOS 4 (PowerPC), AROS (x86, PowerPC, m68k), MorphOS (PowerPC)
- Atari TOS, MiNT
- BSD (many platforms; see NetBSDnet, for example)
- DOS-type systems on the x86: MS-DOS, PC DOS, DR-DOS, FreeDOS
- OS/2, eComStation
- BeOS (PowerPC, x86)
Java
Main article: Java (software platform)The Java language is typically compiled to run on a VM that is part of the Java platform. The Java virtual machine (Java VM, JVM) is a CPU implemented in software, which runs all Java code. This enables the same code to run on all systems that implement a JVM. Java software can be executed by a hardware-based Java processor. This is used mostly in embedded systems.
Java code running in the JVM has access to OS-related services, like disk input/output (I/O) and network access, if the appropriate privileges are granted. The JVM makes the system calls on behalf of the Java application. This lets users to decide the appropriate protection level, depending on an access-control list (ACL). For example, disk and network access is usually enabled for desktop applications, but not for browser-based applets. The Java Native Interface (JNI) can also be used to access OS-specific functions, with a loss of portability.
Currently, Java Standard Edition software can run on Microsoft Windows, macOS, several Unix-like OSs, and several real-time operating systems for embedded devices. For mobile applications, browser plugins are used for Windows and Mac based devices, and Android has built-in support for Java. There are also subsets of Java, such as Java Card or Java Platform, Micro Edition, designed for resource-constrained devices.
Implementation
For software to be considered cross-platform, it must function on more than one computer architecture or OS. Developing such software can be a time-consuming task because different OSs have different application programming interfaces (API).
Software written for one OS may not automatically work on all architectures that OS supports. Just because software is written in a popular programming language such as C or C++, it does not mean it will run on all OSs that support that language—or even on different versions of the same OS.
Web applications
Web applications are typically described as cross-platform because, ideally, they are accessible from any web browser: the browser is the platform. Web applications generally employ a client–server model, but vary widely in complexity and functionality. It can be hard to reconcile the desire for features with the need for compatibility.
Basic web applications perform all or most processing from a stateless server, and pass the result to the client web browser. All user interaction with the application consists of simple exchanges of data requests and server responses. This type of application was the norm in the early phases of World Wide Web application development. Such applications follow a simple transaction model, identical to that of serving static web pages. Today, they are still relatively common, especially where cross-platform compatibility and simplicity are deemed more critical than advanced functionality.
Prominent examples of advanced web applications include the Web interface to Gmail and Google Maps. Such applications routinely depend on additional features found only in the more recent versions of popular web browsers. These features include Ajax, JavaScript, Dynamic HTML, SVG, and other components of rich web applications.
Design
Because of the competing interests of compatibility and functionality, numerous design strategies have emerged.
Many software systems use a layered architecture where platform-dependent code is restricted to the upper- and lowermost layers.
Graceful degradation
Graceful degradation attempts to provide the same or similar functionality to all users and platforms, while diminishing that functionality to a least common denominator for more limited client browsers. For example, a user attempting to use a limited-feature browser to access Gmail may notice that Gmail switches to basic mode, with reduced functionality but still of use.
Multiple codebases
Some software is maintained in distinct codebases for different (hardware and OS) platforms, with equivalent functionality. This requires more effort to maintain the code, but can be worthwhile where the amount of platform-specific code is high.
Single codebase
This strategy relies on having one codebase that may be compiled to multiple platform-specific formats. One technique is conditional compilation. With this technique, code that is common to all platforms is not repeated. Blocks of code that are only relevant to certain platforms are made conditional, so that they are only interpreted or compiled when needed. Another technique is separation of functionality, which disables functionality not supported by browsers or OSs, while still delivering a complete application to the user. (See also: Separation of concerns.) This technique is used in web development where interpreted code (as in scripting languages) can query the platform it is running on to execute different blocks conditionally.
Third-party libraries
Third-party libraries attempt to simplify cross-platform capability by hiding the complexities of client differentiation behind a single, unified API, at the expense of vendor lock-in.
Responsive web design
Responsive web design (RWD) is a Web design approach aimed at crafting the visual layout of sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices, from mobile phones to desktop computer monitors. Little or no platform-specific code is used with this technique.
Testing
Cross-platform applications need much more integration testing. Some web browsers prohibit installation of different versions on the same machine. There are several approaches used to target multiple platforms, but all of them result in software that requires substantial manual effort for testing and maintenance. Techniques such as full virtualization are sometimes used as a workaround for this problem.
Tools such as the Page Object Model allow cross-platform tests to be scripted so that one test case covers multiple versions of an app. If different versions have similar user interfaces, all can be tested with one test case.
Traditional applications
Web applications are becoming increasingly popular but many computer users still use traditional application software which does not rely on a client/web-server architecture. The distinction between traditional and web applications is not always clear. Features, installation methods and architectures for web and traditional applications overlap and blur the distinction. Nevertheless, this simplifying distinction is a common and useful generalization.
Binary software
Traditional application software has been distributed as binary files, especially executable files. Executables only support the platform they were built for—which means that a single cross-platform executable could be very bloated with code that never executes on a particular platform. Instead, generally there is a selection of executables, each built for one platform.
For software that is distributed as a binary executable, such as that written in C or C++, there must be a software build for each platform, using a toolset that translates—transcompiles—a single codebase into multiple binary executables. For example, Firefox, an open-source web browser, is available on Windows, macOS (both PowerPC and x86 through what Apple Inc. calls a Universal binary), Linux, and BSD on multiple computer architectures. The four platforms (in this case, Windows, macOS, Linux, and BSD) are separate executable distributions, although they come largely from the same source code. In rare cases, executable code built for several platforms is combined into a single executable file called a fat binary.
The use of different toolsets may not be enough to build a working executables for different platforms. In this case, programmers must port the source code to the new platform. For example, an application such as Firefox, which already runs on Windows on the x86 family, can be modified and re-built to run on Linux on the x86 (and potentially other architectures) as well. The multiple versions of the code may be stored as separate codebases, or merged into one codebase.
An alternative to porting is cross-platform virtualization, where applications compiled for one platform can run on another without modification of the source code or binaries. As an example, Apple's Rosetta, which is built into Intel-based Macintosh computers, runs applications compiled for the previous generation of Macs that used PowerPC CPUs. Another example is IBM PowerVM Lx86, which allows Linux/x86 applications to run unmodified on the Linux/Power OS.
Example of cross-platform binary software:
- The LibreOffice office suite is built for Microsoft Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD, Android, iOS, iPadOS, ChromeOS, web-based Collabora Online and many others. Many of these are supported on several hardware platforms with processor architectures including IA-32, x86-64, ARM (ARMel, ARMhf, ARM64), MIPS, MIPSel, PowerPC, ppc64le, and S390x
Scripts and interpreted languages
A script can be considered to be cross-platform if its interpreter is available on multiple platforms and the script only uses the facilities built into the language. For example, a script written in Python for a Unix-like system will likely run with little or no modification on Windows, because Python also runs on Windows; indeed there are many implementations (e.g. IronPython for .NET Framework). The same goes for many of the open-source scripting languages.
Unlike binary executable files, the same script can be used on all computers that have software to interpret the script. This is because the script is generally stored in plain text in a text file. There may be some trivial issues, such as the representation of a new line character.
Some popular cross-platform scripting languages are:
- bash – A Unix shell commonly run on Linux and other modern Unix-like systems, as well as on Windows via the Cygwin POSIX compatibility layer, Git for Windows, or the Windows Subsystem for Linux.
- Perl – First released in 1987. Used for CGI programming, small system administration tasks, and more.
- PHP – Mostly used for web applications.
- Python – A language which focuses on rapid application development and ease of writing, instead of run-time efficiency.
- Ruby – An object-oriented language which aims to be easy to read. Can also be used on the web through Ruby on Rails.
- Tcl – A dynamic programming language, suitable for a wide range of uses, including web and desktop applications, networking, administration, testing and many more.
Video games
Cross-platform or multi-platform is a term that can also apply to video games released on a range of video game consoles. Examples of cross-platform games include: Miner 2049er, Tomb Raider: Legend, FIFA series, NHL series and Minecraft.
Each has been released across a variety of gaming platforms, such as the Wii, PlayStation 3, Xbox 360, personal computers, and mobile devices.
Some platforms are harder to write for than others, requiring more time to develop the video game to the same standard. To offset this, a video game may be released on a few platforms first, then later on others. Typically, this happens when a new gaming system is released, because video game developers need to acquaint themselves with its hardware and software.
Some games may not be cross-platform because of licensing agreements between developers and video game console manufacturers that limit development to one particular console. As an example, Disney could create a game with the intention of release on the latest Nintendo and Sony game consoles. Should Disney license the game with Sony first, it may be required to release the game solely on Sony's console for a short time or indefinitely.
Cross-platform play
Main articles: Cross-platform play and List of video games that support cross-platform playSeveral developers have implemented ways to play games online while using different platforms. Psyonix, Epic Games, Microsoft, and Valve all possess technology that allows Xbox 360 and PlayStation 3 gamers to play with PC gamers, leaving the decision of which platform to use to consumers. The first game to allow this level of interactivity between PC and console games (Dreamcast with specially produced keyboard and mouse) was Quake 3.
Games that feature cross-platform online play include Rocket League, Final Fantasy XIV, Street Fighter V, Killer Instinct, Paragon and Fable Fortune, and Minecraft with its Better Together update on Windows 10, VR editions, Pocket Edition and Xbox One.
Programming
Cross-platform programming is the practice of deliberately writing software to work on more than one platform.
Approaches
There are different ways to write a cross-platform application. One approach is to create multiple versions of the same software in different source trees—in other words, the Microsoft Windows version of an application might have one set of source code files and the Macintosh version another, while a FOSS *nix system might have a third. While this is straightforward, compared to developing for only one platform it can cost much more to pay a larger team or release products more slowly. It can also result in more bugs to be tracked and fixed.
Another approach is to use software that hides the differences between the platforms. This abstraction layer insulates the application from the platform. Such applications are platform agnostic. Applications that run on the JVM are built this way.
Some applications mix various methods of cross-platform programming to create the final application. An example is the Firefox web browser, which uses abstraction to build some of the lower-level components, with separate source subtrees for implementing platform-specific features (like the GUI), and the implementation of more than one scripting language to ease software portability. Firefox implements XUL, CSS and JavaScript for extending the browser, in addition to classic Netscape-style browser plugins. Much of the browser itself is written in XUL, CSS, and JavaScript.
Toolkits and environments
There are many tools available to help the process of cross-platform programming:
- 8th: a development language which utilizes Juce as its GUI layer. It currently supports Android, iOS, Windows, macOS, Linux and Raspberry Pi.
- Anant Computing: A mobile application platform that works in all Indian languages, including their keyboards, and also supports AppWallet and native performance in all OSs.
- AppearIQ: a framework that supports the workflow of app development and deployment in an enterprise environment. Natively developed containers present hardware features of the mobile devices or tablets through an API to HTML5 code thus facilitating the development of mobile apps that run on different platforms.
- Boden: a UI framework written in C++.
- Cairo: a free software library used to provide a vector graphics-based, device-independent API. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is written in C and has bindings for many programming languages.
- Cocos2d: an open-source toolkit and game engine for developing 2D and simple 3D cross-platform games and applications.
- Codename One: an open-source Write Once Run Anywhere (WORA) framework for Java and Kotlin developers.
- Delphi: an IDE which uses a Pascal-based language for development. It supports Android, iOS, Windows, macOS, Linux.
- Ecere SDK: a GUI and 2D/3D graphics toolkit and IDE, written in eC and with support for additional languages such as C and Python. It supports Linux, FreeBSD, Windows, Android, macOS and the Web through Emscripten or Binaryen [Wikidata] (WebAssembly).
- Eclipse: an open-source development environment. Implemented in Java with a configurable architecture which supports many tools for software development. Add-ons are available for several languages, including Java and C++.
- FLTK: an open-source toolkit, but more lightweight because it restricts itself to the GUI.
- Flutter: A cross-platform UI framework for Android and iOS developed by Google.
- fpGUI: An open-source widget toolkit that is completely implemented in Object Pascal. It currently supports Linux, Windows and a bit of Windows CE.
- GeneXus: A Windows rapid software development solution for cross-platform application creation and deployment based on knowledge representation and supporting C#, COBOL, Java including Android and BlackBerry smart devices, Objective-C for Apple mobile devices, RPG, Ruby, Visual Basic, and Visual FoxPro.
- GLBasic: A BASIC dialect and compiler that generates C++ code. It includes cross compilers for many platforms and supports numerous platform (Windows, Mac, Linux, Android, iOS and some exotic handhelds).
- Godot: an SDK which uses Godot Engine.
- GTK+: An open-source widget toolkit for Unix-like systems with X11 and Microsoft Windows.
- Haxe: An open-source language.
- Juce: An application framework written in C++, used to write native software on numerous systems (Microsoft Windows, POSIX, macOS), with no change to the code.
- Kivy: an open-source cross-platform UI framework written in Python. It supports Android, iOS, Linux, OS X, Windows and Raspberry Pi.
- LEADTOOLS: Cross-platform SDK libraries to integrate recognition, document, medical, imaging, and multimedia technologies into Windows, iOS, macOS, Android, Linux and web applications.
- LiveCode: a commercial cross-platform rapid application development language inspired by HyperTalk.
- Lazarus: A programming environment for the FreePascal Compiler. It supports the creation of self-standing graphical and console applications and runs on Linux, MacOSX, iOS, Android, WinCE, Windows and WEB.
- Max/MSP: A visual programming language that encapsulates platform-independent code with a platform-specific runtime environment into applications for macOS and Windows A cross-platform Android runtime. It allows unmodified Android apps to run natively on iOS and macOS
- Mendix: a cloud-based low-code application development platform.
- MonoCross: an open-source model–view–controller design pattern where the model and controller are cross-platform but the view is platform-specific.
- Mono: An open-source cross-platform version of Microsoft .NET (a framework for applications and programming languages)
- MoSync: an open-source SDK for mobile platform app development in the C++ family.
- Mozilla application framework: an open-source platform for building macOS, Windows and Linux applications.
- OpenGL: a 3D graphics library.
- Pixel Game Maker MV: A proprietary 2D game development software for Windows for developing Windows and Nintendo Switch games.
- PureBasic: a proprietary language and IDE for building macOS, Windows and Linux applications.
- ReNative: The universal development SDK to build multi-platform projects with React Native. Includes latest iOS, tvOS, Android, Android TV, Web, Tizen TV, Tizen Watch, LG webOS, macOS/OSX, Windows, KaiOS, Firefox OS and Firefox TV platforms.
- Qt: an application framework and widget toolkit for Unix-like systems with X11, Microsoft Windows, macOS, and other systems—available under both proprietary and open-source licenses.
- Simple and Fast Multimedia Library: A multimedia C++ API that provides low and high level access to graphics, input, audio, etc.
- Simple DirectMedia Layer: an open-source multimedia library written in C that creates an abstraction over various platforms' graphics, sound, and input APIs. It runs on OSs including Linux, Windows and macOS and is aimed at games and multimedia applications.
- Smartface: a native app development tool to create mobile applications for Android and iOS, using WYSIWYG design editor with JavaScript code editor.
- Tcl/Tk
- Titanium Mobile: open source cross-platform framework for Android and iOS development.
- U++: a C++ GUI framework for performance. It includes a set of libraries (GUI, SQL, etc..), and IDE. It supports Windows, macOS and Linux.
- Unity: Another cross-platform SDK which uses Unity Engine.
- Uno Platform: Windows, macOS, iOS, Android, WebAssembly and Linux using C#.
- Unreal: A cross-platform SDK which uses Unreal Engine.
- V-Play Engine: V-Play is a cross-platform development SDK based on the popular Qt framework. V-Play apps and games are created within Qt Creator.
- WaveMaker: A low-code development tool to create responsive web and hybrid mobile (Android & iOS) applications.
- WinDev: an Integrated Development Environment for Windows, Linux, .Net and Java, and web browers. Optimized for business and industrial applications.
- wxWidgets: an open-source widget toolkit that is also an application framework. It runs on Unix-like systems with X11, Microsoft Windows and macOS.
- Xojo: a RAD IDE that uses an object-oriented programming language to compile desktop, web and iOS apps. Xojo supports natively compiling to Windows, macOS, iOS and Linux, and can also create compiled web apps that are able to be run as standalone servers or through CGI.
Challenges
There are many challenges when developing cross-platform software.
- Testing cross-platform applications may be considerably more complicated, since different platforms can exhibit slightly different behaviors or subtle bugs. This problem has led some developers to deride cross-platform development as "write once, debug everywhere", a take on Sun Microsystems' "write once, run anywhere" marketing slogan.
- Developers are often restricted to using the lowest common denominator subset of features which are available on all platforms. This may hinder the application's performance or prohibit developers from using the most advanced features of each platform.
- Different platforms often have different user interface conventions, which cross-platform applications do not always accommodate. For example, applications developed for macOS and GNOME are supposed to place the most important button on the right-hand side of a window or dialog, whereas Microsoft Windows and KDE have the opposite convention. Though many of these differences are subtle, a cross-platform application which does not conform to these conventions may feel clunky or alien to the user. When working quickly, such opposing conventions may even result in data loss, such as in a dialog box confirming whether to save or discard changes.
- Scripting languages and VM bytecode must be translated into native executable code each time they are used, imposing a performance penalty. This penalty can be alleviated using techniques like just-in-time compilation; but some computational overhead may be unavoidable.
- Different platforms require the use of native package formats such as RPM and MSI. Multi-platform installers such as InstallAnywhere address this need.
- Cross-platform execution environments may suffer cross-platform security flaws, creating a fertile environment for cross-platform malware.
See also
- Cross-platform play
- Hardware-agnostic
- Software portability
- List of video games that support cross-platform play
- List of widget toolkits
- Hardware virtualization
- Java (software platform)
- Language binding
- Source-to-source compiler
- Binary-code compatibility
- Xamarin
- Comparison of user features of messaging platforms
- Mobile development frameworks, many of which are cross-platform.
References
- "Design Guidelines: Glossary". java.sun.com. Archived from the original on 2012-02-13. Retrieved 2011-10-19.
- "SDD Technology blog: Definition of cross platform". SDD Technology. Retrieved 2020-10-18.
- Lee P Richardson (2016-02-16). "Xamarin vs Ionic: A Mobile, Cross Platform, Shootout".
- ^ "Platform Definition". The Linux Information Project. Retrieved 2014-03-27.
- "About Mono". mono-project.com. Retrieved 2015-12-17.
- Corti, Sascha P. (October 2011). "Browser and Feature Detection". MSDN Magazine. Retrieved 28 January 2014.
- Choudhary, S.R. (2014). "Cross-platform testing and maintenance of web and mobile applications". Companion Proceedings of the 36th International Conference on Software Engineering. pp. 642–645. doi:10.1145/2591062.2591097. hdl:1853/53588. ISBN 9781450327688. S2CID 1903037.
- Mehrotra, Pranob (2020-12-01). "Collabora Office suite gets a new layout for Android tablets and Chromebooks". XDA-Developers. Retrieved 2021-01-15.
Collabora Office is a popular open-source alternative to the Microsoft Office suite. It's based on LibreOffice, and it's available on a variety of platforms, including Windows, Linux, iOS, and Android. This year in July, a major update for the office suite brought support for Chrome OS devices.
- "Collabora Office on iOS and Android Just got Better!". Adfinis. 2020-12-15. Retrieved 2021-01-15.
...touch optimized interfaces: one for tablets and one for phone screens. ...(iOS, iPadOS, Chromebooks, Android).
- "Nextcloud Ubuntu Appliance adds Collabora Online to Raspberry Pi image". MuyLinux. 2021-03-26. Retrieved 2021-03-30.
the first viable self-hosted web office solution for the popular Raspberry Pi 4 platform
- Cribba. Quake III Arena, Giant Bombcast, February 15, 2013.
- A Closer Look At The Dreamcast Internet Starter Kit
- The GUI Toolkit, Framework Page
- "Platform Independent FAQ". Archived from the original on 2008-08-16. Retrieved 2009-04-25.
- "Cross-Platform SDK Libraries for Recognition, Document, Medical, Imaging, and Multimedia". www.leadtools.com. Retrieved 2021-03-03.
- "12 benefits of Xamarin Cross-platform app development". HeadWorks. 15 Mar 2019.
- WxWidgets Description
- Warren, Tom (2020-01-14). "Microsoft bids farewell to Windows 7 and the millions of PCs that still run it". The Verge. Retrieved 2020-02-06.