Platform overview (Android to Windows)

[This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation]

Learn about key similarities and differences between the Android and Windows platforms.

Introduction

Windows 8 is available on various device types including desktops, tablets, and other form factors. Windows 8 has many similarities with Android from operating system architecture to app development concepts, tools, and software development kits (SDKs).

Top

Android kernel

Android is built on top of the Linux kernel that is adapted for mobile devices. Kernel changes include efficient power management, increased security, new hardware support, improved performance of the flash file system, and improved error reporting. Because Android apps are hosted inside a Java virtual machine (JVM) at run time, they can use a subset of Java APIs that are at the core of the Java Development Kit (JDK). Android also provides Java bindings for platform-specific programming areas like power management, user interface, location-based programming, local storage, and cloud services integration.

Top

Windows 8 kernel

Enhancements to the Windows 8 kernel include things like enhanced boot performance, System on a Chip (SoC) features, improved run-time power management of devices, performance enhancements to the user-mode driver framework (UMDF), and security enhancements to UMDF.

Windows 8 has a driver architecture that allows user-mode as well as kernel-mode drivers. User-mode drivers (such as those for cameras and printers) run in a low-privileged environment in user mode, which helps to prevent system crashes resulting from driver quality issues. The following figure shows all Windows 8 drivers running in kernel mode to show parallels between Android and Windows 8.

Top

Android runtime

Typically, Android apps run inside a Dalvik virtual machine (VM) instance, which is a register-based JVM that is optimized for low memory and for devices with mobile-friendly processors. Java class files are converted into Dalvik Executable (.dex) files. These .dex files are interpreted, except when the runtime can just-in-time (JIT)-compile a hot trace. A subset of the Java libraries are included in the Android SDK. Native-coded Android libraries are available to the Java programming environment as language-specific bindings. These Android API calls from Java are sent to native code through the Java Native Interface (JNI).

Top

Windows 8 runtime

The Android runtime equivalent in Windows 8 is the Windows Runtime, which runs Windows Store apps. Windows 8 supports two types of apps: desktop apps and Windows Store apps. Windows Store apps run separately from each other, a mechanism known as sandboxing, which tightly controls access to system resources. Permissions for accessing system resources (such as networks and the file system) must be explicitly requested by the app at development time. At run time, when the app tries to access a protected resource, the user must give permission through a consent UI. Additionally, Windows Store apps can only be installed from trusted sources like the Windows Store (which is similar to Google Play), or with signed certificates using a technique called sideloading.

In contrast, desktop apps on Windows 8 run with privileges that are implicitly inherited from the user that started the app. Desktop app code is completely trusted, so no discretionary permissions are required by users, unless the code started from a location like an external file share or from the Internet. Additionally, desktop apps can be installed from arbitrary sources.

The Windows 8 equivalent to the Android Dalvik VM is the Microsoft .NET common language runtime (CLR). Each Windows Store app instance creates a separate .NET CLR instance for running code that's written in .NET languages like C# and Microsoft Visual Basic.NET. .NET code gets deployed as Microsoft intermediate language (MSIL) bytecode that gets JIT-compiled into processor-specific instructions at run time. This is similar to compiling Java source code into .dex files and then interpreting these .dex files at run time in Android.

The Windows Runtime allows only a subset of .NET APIs to be used inside Windows Store apps. This includes I/O, language-integrated query (LINQ) collections, networking, HTTP object serialization, threading, Windows Communications Foundation (WCF), and XML. For more info, see .NET for Windows Store apps - supported APIs.

Windows Store apps using JavaScript call directly into the Windows Runtime APIs. The Windows Runtime APIs are a collection of Component Object Model (COM) components that wrap Windows core APIs. These components are available to various languages including C#, Visual Basic.NET, C++, and JavaScript through programming language-specific projections. The projections are Windows metadata (.winmd) files that are used by Microsoft Visual Studio and the various programming language compilers to replace programming language-specific API calls with Windows Runtime API calls.

Top

Libraries

Windows Runtime APIs are a collection of native components implemented in COM that is familiar to most Windows programmers. For Android developers who are new to Windows, COM is a remote procedure call (RPC)-based technology that creates and manages programmatic object lifecycle through class factories and reference counting. The complexity of the COM part of the Windows Runtime APIs is hidden through programming language projections.

Similar to Android, the Windows Runtime has APIs for things like media playback, networking, file storage, and geolocation. Android libraries like SGL, libc, and Secure Sockets Layer (SSL) have equivalents in Windows 8 through an Extensible Application Markup Language (XAML) rendering engine, a C runtime, and an SSL implementation. Even though SQLite is not included in the Windows Runtime, there are open source libraries compatible with the Windows Runtime that enable developers to call SQLite databases from Windows Store apps.

Equivalent to WebKit on Android, HTML rendering is done through the Windows Internet Explorer "Trident" layout engine in Windows 8. Both platforms have a similarly-named class—WebView—for embedding web sites within apps.

Top