Cross-platform software

(Redirected fromMulti-platform)

Incomputing,cross-platform software(also calledmulti-platform software,platform-agnostic software,orplatform-independent software) iscomputer softwarethat is designed to work in severalcomputing platforms.[1]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 aninterpreted languageor compiled to portablebytecodefor which theinterpretersor run-time packages are common or standard components of all supported platforms.[2]

For example, a cross-platformapplicationmay run onLinux,macOSandMicrosoft Windows.Cross-platform software may run on many platforms, or as few as two. Some frameworks for cross-platform development areCodename One,ArkUI-X,Kivy,Qt,GTK,Flutter,NativeScript,Xamarin,Apache Cordova,Ionic,andReact Native.[3]

Platforms

edit

Platformcan refer to the type of processor (CPU) or other hardware on which anoperating system(OS) orapplicationruns, the type of OS, or a combination of the two.[4]An example of a common platform isAndroidwhich runs on theARM architecture family.Other well-known platforms areLinux/Unix,macOSandWindows,these are all cross-platform.[4]Applications can be written to depend on the features of a particular platform—either the hardware, OS, orvirtual machine(VM) it runs on. For example, theJava platformis a common VM platform which runs on many OSs and hardware types.

Hardware

edit

A hardware platform can refer to aninstruction 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 othermobile operating systems.

Software

edit

Asoftware platformcan be either anoperating system(OS) orprogramming environment,though more commonly it is a combination of both. An exception isJava,which uses an OS-independentvirtual machine(VM) to executeJava bytecode.Some software platforms are:

Minor, historical

Java

edit

TheJava languageis typically compiled to run on a VM that is part of the Java platform. TheJava 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-basedJava processor.This is used mostly in embedded systems.

Java code running in the JVM has access to OS-related services, like diskinput/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 anaccess-control list(ACL). For example, disk and network access is usually enabled for desktop applications, but not for browser-basedapplets.TheJava 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 severalreal-time operating systemsfor 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 asJava CardorJava Platform, Micro Edition,designed for resource-constrained devices.

Implementation

edit

For software to be considered cross-platform, it must function on more than onecomputer architectureor OS. Developing such software can be a time-consuming task because different OSs have differentapplication 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 popularprogramming languagesuch asCorC++,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

edit

Web applicationsare typically described as cross-platform because, ideally, they are accessible from anyweb browser:the browser is the platform. Web applications generally employ aclient–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 astateless 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 ofWorld Wide Webapplication development. Such applications follow a simpletransactionmodel, identical to that of servingstatic 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 toGmailandGoogle Maps.Such applications routinely depend on additional features found only in the more recent versions of popular web browsers. These features includeAjax,JavaScript,Dynamic HTML,SVG,and other components ofrich web applications.

Design

edit

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
edit

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
edit

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
edit

This strategy relies on having one codebase that may be compiled to multiple platform-specific formats. One technique isconditional 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 onlyinterpretedorcompiledwhen 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.[6]

Third-party libraries
edit

Third-party libraries attempt to simplify cross-platform capability by hiding the complexities of client differentiation behind a single, unified API, at the expense ofvendor lock-in.

Responsive web design
edit

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

edit

Cross-platform applications need much moreintegration 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.[7]Techniques such asfull virtualizationare 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

edit

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

edit

Traditional application software has been distributed as binary files, especiallyexecutable 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 asoftware buildfor 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 (bothPowerPCand x86 through whatApple Inc.calls aUniversal 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 samesource code.In rare cases, executable code built for several platforms is combined into a single executable file called afat binary.

The use of different toolsets may not be enough to build a working executables for different platforms. In this case, programmers mustportthe 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 iscross-platform virtualization,where applications compiled for one platform can run on another without modification of the source code or binaries. As an example, Apple'sRosetta,which is built intoIntel-based Macintosh computers, runs applications compiled for the previous generation of Macs that used PowerPC CPUs. Another example is IBMPowerVM Lx86,which allows Linux/x86 applications to run unmodified on the Linux/Power OS.

Example of cross-platform binary software:

Scripts and interpreted languages

edit

A script can be considered to be cross-platform if itsinterpreteris available on multiple platforms and the script only uses the facilities built into the language. For example, a script written inPythonfor aUnix-likesystem will likely run with little or no modification on Windows, because Python also runs on Windows; indeed there are many implementations (e.g.IronPythonfor.NET Framework). The same goes for many of theopen-sourcescripting 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 inplain textin atext file.There may be some trivial issues, such as the representation of anew line character.

Some popular cross-platform scripting languages are:

  • bash– AUnix shellcommonly run on Linux and other modern Unix-like systems, as well as on Windows via theCygwinPOSIXcompatibility layer,Gitfor Windows, or theWindows Subsystem for Linux.
  • Perl– First released in 1987. Used forCGIprogramming, smallsystem administrationtasks, and more.
  • PHP– Mostly used for web applications.
  • Python– A language which focuses onrapid application developmentand 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 throughRuby 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

edit

Cross-platform or multi-platform is a term that can also apply tovideo gamesreleased on a range ofvideo game consoles.Examples of cross-platform games include:Miner 2049er,Tomb Raider: Legend,FIFA series,NHL seriesandMinecraft.

Each has been released across a variety of gaming platforms, such as theWii,PlayStation 3,Xbox 360,personal computers,andmobile 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, becausevideo game developersneed 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,Disneycould create a game with the intention of release on the latestNintendoandSonygame 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 timeor indefinitely.

Cross-platform play

edit

Several developers have implemented ways to play games online while using different platforms.Psyonix,Epic Games,Microsoft,andValveall 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) wasQuake 3.[11][12]

Games that feature cross-platformonline playincludeRocket League,Final Fantasy XIV,Street Fighter V,Killer Instinct,ParagonandFable Fortune,andMinecraftwith its Better Together update onWindows 10,VR editions,Pocket EditionandXbox One.

Programming

edit

Cross-platform programming is the practice of deliberately writing software to work on more than one platform.

Approaches

edit

There are different ways to write a cross-platform application. One approach is to create multiple versions of the same software in differentsource trees—in other words, the Microsoft Windows version of an application might have one set of source code files and theMacintoshversion another, while aFOSS*nixsystem 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. Thisabstraction layerinsulates the application from the platform. Such applications areplatform 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 easesoftware portability.Firefox implementsXUL,CSSand JavaScript for extending the browser, in addition to classicNetscape-style browser plugins. Much of the browser itself is written in XUL, CSS, and JavaScript.

Toolkits and environments

edit

There are many tools[13][14]available to help the process of cross-platform programming:

  • 8th:a development language which utilizesJuceas 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:afree softwarelibrary 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(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 byGoogle.
  • 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 onknowledge representationand supportingC#,COBOL,Javaincluding Android and BlackBerry smart devices,Objective-CforApplemobile devices,RPG,Ruby,Visual Basic,andVisual 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 inPython.It supportsAndroid,iOS,Linux,OS X,WindowsandRaspberry Pi.
  • LEADTOOLS:Cross-platform SDK libraries to integrate recognition, document, medical, imaging, and multimedia technologies into Windows, iOS, macOS, Android, Linux and web applications.[15]
  • 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:Avisual programming languagethat 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-sourcemodel–view–controllerdesign pattern where the model and controller are cross-platform but the view is platform-specific.[16]
  • Mono:An open-source cross-platform version ofMicrosoft.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 andNintendo Switchgames.
  • 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 andwidget toolkitforUnix-likesystems withX11,Microsoft Windows, macOS, and other systems—available under both proprietary andopen-source licenses.
  • Simple and Fast Multimedia Library:A multimedia C++APIthat 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 inputAPIs.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, usingWYSIWYGdesign 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 anapplication framework.[17]It runs onUnix-likesystems withX11,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

edit

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 onSun Microsystems' "write once, run anywhere"marketing slogan.
  • Developers are often restricted to using thelowest common denominatorsubset 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 andGNOMEare supposed to place the most important button on the right-hand side of a window or dialog, whereas Microsoft Windows andKDEhave 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 indata loss,such as in adialog boxconfirming 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 likejust-in-time compilation;but some computational overhead may be unavoidable.
  • Different platforms require the use of native package formats such asRPMandMSI.Multi-platform installers such asInstallAnywhereaddress this need.
  • Cross-platform execution environments may suffer cross-platform security flaws, creating a fertile environment for cross-platform malware.[18]

See also

edit

References

edit
  1. ^"Design Guidelines: Glossary".java.sun. Archived fromthe originalon 2012-02-13.Retrieved2011-10-19.
  2. ^"SDD Technology blog: Definition of cross platform".SDD Technology.Retrieved2020-10-18.
  3. ^Lee P Richardson (2016-02-16)."Xamarin vs Ionic: A Mobile, Cross Platform, Shootout".
  4. ^ab"Platform Definition".The Linux Information Project.Retrieved2014-03-27.
  5. ^"About Mono".mono-project.Retrieved2015-12-17.
  6. ^Corti, Sascha P. (October 2011)."Browser and Feature Detection".MSDN Magazine.Retrieved28 January2014.
  7. ^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.ISBN9781450327688.S2CID1903037.
  8. ^Mehrotra, Pranob (2020-12-01)."Collabora Office suite gets a new layout for Android tablets and Chromebooks".XDA-Developers.Retrieved2021-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.
  9. ^"Collabora Office on iOS and Android Just got Better!".Adfinis.2020-12-15.Retrieved2021-01-15....touch optimized interfaces: one for tablets and one for phone screens....(iOS, iPadOS, Chromebooks, Android).
  10. ^"Nextcloud Ubuntu Appliance adds Collabora Online to Raspberry Pi image".MuyLinux.2021-03-26.Retrieved2021-03-30.the first viable self-hosted web office solution for the popular Raspberry Pi 4 platform
  11. ^Cribba.Quake III Arena,Giant Bombcast,February 15, 2013.
  12. ^A Closer Look At The Dreamcast Internet Starter Kit
  13. ^The GUI Toolkit, Framework Page
  14. ^"Platform Independent FAQ".Archived fromthe originalon 2008-08-16.Retrieved2009-04-25.
  15. ^"Cross-Platform SDK Libraries for Recognition, Document, Medical, Imaging, and Multimedia".leadtools.Retrieved2021-03-03.
  16. ^"12 benefits of Xamarin Cross-platform app development".HeadWorks.15 Mar 2019.
  17. ^WxWidgets Description
  18. ^Warren, Tom (2020-01-14)."Microsoft bids farewell to Windows 7 and the millions of PCs that still run it".The Verge.Retrieved2020-02-06.