Embedded Linux is hard to define, but at least we know now that Linux pros say Android is not embedded Linux. (See part 1 in this series, Android vs. Embedded Linux and this weekâ€™s Q&A with Mentor Graphicsâ€™ John Cherry.) That doesnâ€™t mean, however, that Android isnâ€™t useful in some embedded projects. The question is: How does a developer know which operating system to choose?
While the answer can be complicated, independent embedded engineering consultant Steve Sakoman attempted to simplify the decision-making process for us.
In a few cases the answer is obvious, he said. Both embedded Linux and Android need a reasonably high-end processor to support them. If your project requires a tiny processor either for budget or design reasons, itâ€™s best to go with an alternative OS, Sakoman said.
â€œAlways pick the most cost effective solution hardware-wise, and if itâ€™s good enough to run Linux, thatâ€™s your answer,â€ he said. â€œIf itâ€™s not, use one of the open solutions.â€
Similarly, neither Android nor embedded Linux is the ideal choice for a device with hard real-time requirements, Sakoman said. Use a Real Time Operating System or a distro that includes the PREEMPT-RT real-time kernel patch (see kernel developer Steven Rostedt’s Embedded Linux Conference presentation for an update on the RT patch.)
If the project has a heavy user interface component and it needs downloadable applications and content â€“ use Android, Sakoman said. Also, if you want to do your programming in Java, Android is the right choice, he said.
If youâ€™re more of a C/ C++ developer or your project doesnâ€™t need any of the Google goodies that come with Android and its ecosystem, such as the maps and documents cloud services, stick with embedded Linux. The majority of embedded projects will fare better running Linux, he said.
â€œWhen a potential client tells me they want to use Android on their embedded device, my gut reaction is to be “too busy” to take on the work!
â€œThe above is of course tongue-in-cheek. But more often than not this type of client is only asking for Android because their management read an article about how Android is taking over the embedded world.
â€œWhen we discuss the product requirements Android often turns out to be a really bad choice,â€ writes Sakoman.
Pros and Cons of Android on Embedded Devices
So the decision is pretty simple then, right? Not so fast. Thereâ€™s a huge gray area in between an obvious Android project and a classic, fixed-function device running embedded Linux. As everyday devices take on the features of smartphones or tablets, the choice becomes harder. It pays in this situation to compare some of the pros and cons of Android as an embedded OS.
Below are some considerations raised by Linux pros during a panel discussion at Android Builders Summit last month. For a more in-depth discussion of Androidâ€™s features as an embedded OS see The Linux Foundation’s white paper, “The Growth of Android in Embedded Systems” and PlexTek Consultingâ€™s recent white paper â€œUsing Android in your embedded product.â€
– Android has a familiar UI. By now most users are accustomed to the â€œpinchy swirly zoomyâ€ nature of the Android touch interface, said David Stewart, Embedded Linux engineering manager at Intel. This allows for more intuitive device designs for the user.
– Itâ€™s natively mobile. Android was designed from scratch with embedded systems in mind. â€œWhen I first looked at the Android stack it was such a breath of fresh air,â€ said Tim Bird, senior staff engineer for Sony Entertainment. â€œLike I wasnâ€™t trying to wedge Unix into the embedded space anymore.â€ For example, the way it handles crashes and does logging is different from traditional Linux and â€œitâ€™s way better for the embedded space,â€ he said.
– Lots of developers know Android and Java. It may be easier to find developers for a project.
– APIs make for easy development of applications. Developers donâ€™t need to know the underlying Android architecture, just the APIs, said Zach Pfeffer, who leads the Android effort at Linaro.
– Google has ultimate control over Androidâ€™s direction. This is fine if the current Android release supports what you need to do, if you can accept the risk that future releases might not, or if can you just stick with that release forever, Sakoman said. Otherwise, â€œwhen the next dessert comes out and the middleware has changed all your stuff has to get redone,â€ David Stewart said.
– Android has a large software stack. This makes it hard to whittle down features without disturbing dependencies. It also hogs memory so the project needs a high-end processor.
– Itâ€™s more difficult to add hardware support. For example, â€œitâ€™s not trivial to add a totally new type of sensor to Android,â€ said Mike Anderson, chief scientist at The PTR Group, â€œâ€¦unless you dig into the AOSP and understand how itâ€™s all put together.â€
– It requires a different developer skillset. â€œOnce youâ€™re in Android, youâ€™re in Android,â€ said Anderson. â€œBecause now Iâ€™m no longer opening a POSIX pipe to talk between daemons. Iâ€™m writing in Java.â€