Android, renowned as a highly popular mobile operating system, has established itself as one of the most secure platforms available for mobile devices. Its robust security infrastructure makes it a viable choice also for a variety of embedded systems and IoT devices. Android features an array of built-in security measures, including encryption, app sandboxing, efficient memory management, comprehensive support for establishing a whole chain of trust, and the incorporation of a Trusted Execution Environment (TEE), among others. These features have been introduced across multiple iterations of the Android Open Source Project (AOSP), contributing to its maturity beyond its initially appealing graphical user interface and user interaction.
Even though Android has been designed to use Java services to provide an extensive SDK to be used in Java/Kotlin, the runtime environment is very different from standard JVM/JIT. The Standard C library Bionic and the Android runtime ART have been designed to run on devices with limited resources.
After adopting OpenJDK (from Android N), Android's support for future improvements won’t require any specific Java-related Android porting from Google. This is definitively good news for porting existing pure Java code that runs on GNU/Linux, into Android applications. Still porting and building successfully an existing code base to Android may be very challenging, especially if the project involves a particular, more advanced, Open JDK version and/or a lot of external dependencies.
Running the application/service in a Docker container can be a valuable solution in this scenario. Docker is not supported natively by Android. Although, with some hacks, we can successfully run Docker, and under certain conditions, we can entirely run non-Android builds of a project/application in a containerized environment that have all the required dependencies. This approach can benefit the adoption of Eclipse Projects in an Android-based embedded operating system. As an example, we will try to run, in a container, a selected Eclipse code base built in its “native” environment.