Ambient Dynamix is a lightweight software framework that transforms a user’s mobile device into an adaptive smart gateway to the Internet of Things (IoT). Dynamix enables native apps and Web apps to fluidly interact with the physical world through advanced sensing, control and actuation plug-ins that can be installed into the user’s device on-demand. A Dynamix-enabled device can also serve as a gateway between mutually incompatible connected devices that are situated in the user’s environment. Dynamix comes with a growing collection of ready-made plug-ins and provides open SDKs that enable 3rd party developers to create and share new plug-in types with the community. Dynamix runs as background service on the user’s mobile device, leveraging the device itself as a sensing, processing and communications platform. Applications request context support from a local Dynamix instance using simple APIs. Dynamix automatically discovers, downloads and installs the plug-ins needed for a given sensing or actuation task. When the user changes environments, new or updated plug-ins can be deployed to the device at runtime, without the need to restart the application or framework. Dynamix is released under the Apache 2 open source license.

Dynamix is designed as an Android Service that runs in the background providing context-awareness services to (potentially many) applications. The Dynamix Framework operates according to the Android Service Lifecycle and is kept alive as long as there are sufficient device resources. Although Dynamix generally serves applications invisibly in the background, users can configure its settings using an inbuilt graphical user interface, which provides a means of controlling the context firewall, installing features, performing updates, adjusting settings, etc. Apps can easily access sophisticated context sensing or control capabilities through Dynamix plug-ins, which can be dynamically installed into the device during runtime (without needing to restart Dynamix or the calling app).

Dynamix Apps

As shown in Figure 1, a Dynamix Service is situated between a device’s local hardware and (potentially many) Dynamix apps, which execute in their own runtime processes.


Figure 1: Overview of the Dynamix Framework

Dynamix supports two principal app types: Native apps and Web apps. Native apps are defined as Android applications that communicate with a local Dynamix service using its AIDL-based application programming interfaces (APIs), which are included in the App SDK (see the native app quick-start guide). These interfaces include a Facade API, which enables apps to request and control context support (discussed next), and an integrated Event API that enables apps to receive framework notifications and context events. Dynamix 2 now supports callbacks for most asynchronous operations, allowing method calls to be easily chained together using events.

Dynamix also supports Web apps by exposing REST-based APIs through a local Web server that is embedded within the Dynamix Service. Web agents can communicate directly with the REST APIs directly or utilize our JavaScript API, which simplifies Dynamix interactions by handling API calls, data serialization/deserialization, and event processing (see the Web app quick-start guide). Web apps can access most of the Dynamix APIs available to native Android applications. Dynamix provides inbuilt security for browser-based Web apps running on the Dynamix device, and provides remote pairing facilities for a variety of remote Web agents (e.g., PC’s, Mac’s, Linux devices, including Rasperry Pi). A python binding library is currently in here: Dynamix 2 Python Binding Library.

Context Support

Apps perform interactions with their environment by requesting context support from a Dynamix instance. Context support represents a specific type of computational functionality provided by one or more Dynamix plug-ins, such as the ability to sense light levels, discover media devices or control a drone helicopter. Context support is requested by apps using a context type, which is a unique, string-based identifier that is generally written in the reverse domain name format. For example, the string ‘org.ambientdynamix.contextplugins.pedometer’ can be used to request context support for detecting user steps and step force (for determining walking vs. running). Context support may be defined by a single plug-in, or defined more generally through the use of a standardized API and standardized data types, allowing multiple plug-ins to implement the functionality.


Dynamix plug-ins perform the actual low-level work necessary to handle an app’s requests for context support, such as controlling network-based lighting or reading information from a heart-rate sensor. Each plug-in supports one or more context types, providing an API for controlling its functionality and an optional set of data types that can be used to return results from various operations (see the plug-in documentation for details). When a plug-in returns data to a requesting app, it encodes context events using Plain Old Java Objects (POJOs), which enable apps to work with objects-based context representations rather than potentially cumbersome strings. The Dynamix project provides a growing list of available context plug-ins, which can be browsed here.

Plug-ins can be manually installed into a Dynamix Service or deployed automatically in the background in response to app requests (from a configurable set of public or private repositories). Plug-ins are automatically deployed along with all their dependencies (e.g., linked code libraries, resources, assets), which allows Dynamix-based apps to easily install complex context support using only a few lines of code. Plug-ins are packaged and deployed as OSGi bundles, which are Java Archive (JAR) files with additional metadata.

To manage plug-ins internally, the Dynamix Framework utilizes an industry standard OSGi container, which is used to dynamically integrate mobile code, provide secure access to local resources, impose a comprehensive plug-in life-cycle model, handle dependency management and enforce plug-in versioning.  Context Plug-ins are loaded into the Dynamix Framework’s runtime process (with additional security constraints) and operate in accordance with a tightly controlled lifecycle. Private repositories can be configured by users, and the Dynamix project hosts a public plug-in repository using a load-balanced, high-availability server architecture. To reduce server-side complexity, client-side logic built into the Dynamix Service provides plug-in discovery services, including local capability analysis, plug-in filtering (based on local capabilities and plug-in requirements) and plug-in installation.

Context plug-ins interact directly with the device’s underlying capabilities within a Plug-in Security Sandbox, which provides secured access to system resources, user data and Android services. The plug-in sandbox is being developed using a combination of OSGi security, a custom Java security manager, and a secured version of the Android Context (to control access to system resources, such as sensor managers). A complimentary plug-in permission model is also being developed to allow users to control (and modify) a plug-in’s access to system resources. All interactions between the Dynamix Service and plug-ins are multi-threaded (to prevent blocking) and are monitored for timely completion.

Dynamix UI

Dynamix generally runs invisibly as an Android background service; however, it can be controlled and customized using its user interface (UI). A screenshot of the Dynamix UI is shown below:

Figure 2: The Dynamix Framework UI’s Applications Tab (A) and Context Firewall Editor (B)

As shown in the Figure 2A above, the Dynamix UI includes several tabs along the top, which are described below:

  1. Applications: This tab lists the various applications that have connected to the Dynamix instance. Tapping an app opens the Context Firewall Editor (see Figure 2B) for the app, which allows users to precisely the context support available to the app (described in the next section). Tapping the (X) next to an app removes its stored Context Firewall rules.
  2. Features: This tab lists add-on functionality provided by some plug-ins, which can be launched and controlled by the user directly within the Dynamix UI itself. One example of a plug-in feature is the optical app pairing functionality provided by the barcode plug-in.
  3. Installed Plug-ins: This tab lists the currently installed plug-ins. Plug-ins can also be deactivated and uninstalled from this tab.
  4. Available Plug-ins: This tab lists the currently available plug-ins. Plug-ins can be installed from this tab, although plug-in installation is usually initiated by apps.

Other UI features include:

  1. Power Button: The button in the upper right of the UI activates and deactivates the Dynamix framework. When the framework is inactive, apps are unable to communicate with Dynamix.
  2. Refresh Button: Refreshes the available plug-ins and installs Dynamix updates (if necessary).
  3. Menu: By pressing the Dynamix Menu button, options for accessing Dynamix settings and shutting down are presented.

Context Firewall

As plug-ins may expose sensitive information or allow control of connected devices, Dynamix provides an intuitive Context Firewall that enables users to control the context support available to an application. By default, apps connecting to Dynamix have no permissions, meaning that they are unable to access context support initially (i.e., opt-in permissions). When an app requests context support, Dynamix opens the Context Firewall Popup for the app, as shown in Figure 3 below.

dynamix-2-context-firewallFigure 3: The Dynamix Framework Context Firewall Popup

The Context Firewall Popup opens automatically over the top of apps requesting context support from Dynamix (for both native apps and Web apps). The requesting app is securely identified at the top of the popup and the requested context support is listed below. Each context support request includes a description, risk rating and one ore more associated plug-ins (tap the down arrow to see the supporting plug-ins). The permission options available in the Context Firewall Popup are as follows:

  • Always: If selected, the app will always be allowed to use the specified context support (i.e., additional requests will be automatically granted).
  • Once: If selected, the app will be allowed to use the specified context support for one session (i.e., once the app disconnects from Dynamix, the popup will shown again for subsequent context support request).
  • Never: If selected, the app will never be allowed to use the specified context support (i.e., additional requests will be automatically blocked).

Context Firewall rules are saved only when the user taps “Okay” in the Context Firewall Popup. If the user taps “Dismiss” or “Back”, the context support requests are rejected and no rules are saved. Saved rules can be modified or removed at any time by tapping the app in the Dynamix UI, which opens the Context Firewall Editor (see Figure 2B above).


We view the Dynamix Framework as the foundation of a broader community initiative that can be used to unlock the wealth of context expertise that is often inaccessible to mobile app developers. An overview of the various Dynamix developer communities is shown below in Figure 4.


Figure 4: Dynamix Developer Communities

As shown above, the infrastructure developer community is responsible for creating the Dynamix framework and the associated plug-in repository architectures. The Dynamix Framework itself is open source, and contributions are encouraged. For details on how to get involved in framework development, see this link.

The plug-in developer community wraps domain expertise into reusable context plug-ins and context types, which can be dynamically provisioned to Dynamix-based devices on-demand. To support the plug-in developer community, the Dynamix project provides an open Plug-in SDK, which provides the foundational classes, documentation and samples necessary for 3rd party domain experts to create a wide variety of plug-ins for the Dynamix Framework.

Finally, the app developer community creates Android-based software based on the Dynamix framework and contributed context plug-ins. To support the app developer community, the Dynamix project provides an open App SDK, which provides the foundational classes, documentation and samples necessary for mobile developers to create IoT apps using the Dynamix Framework.