Whitepaper: Running Native Windows Applications On iOS and Android Devices

Introduction

 

When the Apple Store debuted in 2008, it had only 500 applications available.  By 2010, that number had ballooned to 150K but over 50% of them were games and book subscriptions.  Business applications accounted for just 3.5%. This is understandable since these applications are typically custom-built for businesses, take years to develop and are dependent on Windows OS which doesn’t run Apple or Android devices.

With the introduction of the Apple iPad and Android-based tablets in 2010, mobile business users began demanding accessibility to their business apps on those devices.   Unfortunately, the time and expense to port those applications to these new platforms left a big gap in availability.

Roger Cruz, founder and CTO of Apposable Software, devised a solution that allows businesses to easily package their unmodified Windows applications and deploy them on iOS and Android tablets.  In just a matter of minutes, business applications can be running at the tap of a finger without a single code byte changed.  Moreover, applications instantly benefit from mobile features as well; pinch and zoom are available to native Windows apps thanks to the tight integration between Apposable’s runtime and the mobile OS. 

For customers concerned with the security of corporate data stored in mobile tablets, an optional feature provides encryption at rest for stored files and authentication verification at application launch. The unique technology in Apposable’s runtime intercepts calls to the operating system, thereby providing additional capabilities the original application never supported.

 

Transparent Windows OS Replacement

 

Applications developed to run Windows OS are compiled against Microsoft-published Application Programming Interfaces (APIs) and need to load shared libraries found in the operating system to function properly.  To draw to rectangle to the screen, for example, an application loads a Windows-provided library, WinGDI.dll, that implements the published API for Rectangle().

Apposable’s solution can run Windows-based applications by intercepting calls to load shared libraries and dynamically replacing them with API-equivalent libraries from the open-source WINE project. WINE is a Windows replacement effort to run Windows applications on Linux.

To gain native CPU speeds, Apposable ported the WINE libraries to ARM, the CPU used on iPads and Android tablets.  It also achieved additional performance by directly translating some Windows APIs to the mobile OS APIs, bypassing WINE’s implementations.   For example, the Windows API to draw a rectangle is automatically translated to Android’s OpenGL glRectf() call. 

This API integration with the mobile OS libraries allows for the pinch and zoom functionality to be applied transparently to the native Windows applications.  Similarly, file system API calls are intercepted during file read and write operations to provide encryption at rest.

 

Application Binary Interface Translation

 

In computer software, an application binary interface (ABI) is a well-defined agreement two compiled components use to communicate with each other.  It defines how to interpret function names and how to locate the function’s input and output parameters. 

The ABI definition is specified at machine-code level, which in essence ties it to a particular CPU architecture.   Thus, Intel’s x86 ABI is completely different from ARM’s ABI.  When the source code “a = foo(b);” is compiled for x86, the compiler places the parameter “b” in a well-defined memory location relative to the program’s stack and obtains the function’s return value “a” from a well-defined CPU register.  The same code compiled for ARM passes and returns all the data in CPU registers, never using memory.  This difference in the calling convention between the two architectures requires an ABI translator when attempting to connect components compiled for different CPUs. 

 

 

 

Apposable uses an open-source x86 emulator to emulate the native application x86 machine code but the moment a call to a Windows OS API is detected, it automatically performs the necessary ABI translation from x86 to ARM before the call enters the Windows replacement module described in the previous section.  The proprietary implementation makes sure that function parameters and return values are copied to the correct location in memory and CPU registers when ARM execution begins and ends.

 

Availability and Limitations

 

Apposable’s runtime is available as a closed-beta Android application and downloadable from Apposable’s site (not yet available in Google Play store) while the iOS version is still in development.

The Windows x86 application executables (EXEs) and application libraries (DLLs) need to be zipped into a flat file (no folders).

Both, the runtime and the application zip, must be uploaded to the target device via a wired connection. 

Apposable expects this process to improve as it receives necessary approvals from Google for its runtime application and it provides a Windows application to expedite the packaging and deployment of customer applications.

For best user experience, Apposable recommends tablets with dual-core ARM CPUs.