You can use the Runtime for APK to run your .apk applications on QNX platforms.
On a typical mobile device, the Dalvik virtual machine runs on Linux as a root user. The applications are sandboxed and the interfaces to device-specific resources, such as the camera, the phone and the Wi-Fi, are abstracted by the API.
On QNX platforms, the Runtime for APK isn't allowed to operate as root because this restriction ensures that the APK Runtime can't interfere with the QNX platform software. The Runtime for APK itself is sandboxed to protect the rest of the system from any unpredictable APK applications.
To allow Runtime for APK to operate normally while still protecting the QNX system, the following modifications have been made to how the Runtime for APK is implemented:
The system maps the Runtime for APK into a special UID/GID range (800-999) and allows UID 800 (AID_ROOT) to act as root in specific parts of the filesystem.
The runtime has a set of low-level libraries (for example, libc) named libbionic. QNX has reimplemented libbionic to map Linux system calls into Neutrino RTOS kernel messages where necessary.
The libbionic library maps between system UID/GIDs and Runtime for APK UID/GIDs, so that a call to getuid() in the main Runtime for APK process returns root (0), which is actually 800 for the OS.
Some actions of the QNX platform (for example, interactions with the screen, notifications regarding app installation, and so on) take place via updates to PPS objects. In some cases, Runtime for APK system elements have been modified to monitor these specific PPS objects for events.
Adaptive Partitioning restricts the amount of CPU the Runtime for APK can consume (40% by default). This restriction ensures that sufficient CPU is available for other applications because the APK Runtime works on the assumption that it owns the CPU.
The QNX platform creates file resources that are fundamental assumptions in the Runtime for APK. Specifically, /data and /system are process manager symlinks into the Runtime for APK sandbox.
The QNX platform's apk_launcher starts the Runtime for APK binary under the control of the Application Launcher and the Authorization Manager to enforce specific procmgr abilities and file Access control lists (ACLs).
The Runtime for APK is installed as a native application, located in the/apps/sys.apkruntime.gYABgKAOw1czN6neiAT72SGO.ns directory. At runtime, symlinks in the /data and /system directories point into the sandbox for the Runtime for APK application (/accounts/1000/appdata/sys.apkruntime.gYABgKAOw1czN6neiAT72SGO.ns/).
APK applications that have been dismissed by a user are terminated immediately and any system resources allocated are released.