{"id":521,"date":"2010-04-15T20:27:20","date_gmt":"2010-04-15T20:27:20","guid":{"rendered":"http:\/\/www1.edatechforum.com\/?p=521"},"modified":"2014-06-28T12:56:18","modified_gmt":"2014-06-28T12:56:18","slug":"android-for-the-rest-of-us","status":"publish","type":"post","link":"https:\/\/www.techdesignforums.com\/practice\/technique\/android-for-the-rest-of-us\/","title":{"rendered":"Android for the rest of us"},"content":{"rendered":"<p>Hardly a day goes by without the arrival of a new Android phone commercial or rumors emerging about Google\u2019s next innovation. Android is magnetic: it is attracting the best application developers, assembling the largest collection of ODMs, recruiting leading software and semiconductor vendors (aka the Open Handset Alliance), and thus becoming \u201cthe new black\u201d for marketing engineers everywhere. But assuming that you are not developing the next iPhone killer or blog-worthy app, why should any of this matter to you?<\/p>\n<p>Android is already invading e-readers, media players, netbooks, GPS systems, Internet tablets, digital photo frames, VoIP phones, set-top boxes and more. Yes, these are somewhat natural extensions of the phone with their touch screens, responsive graphical user interfaces (GUIs) and built-in connectivity\u2014and yes, consumer electronics accounts for only a small percentage of the embedded device market. But my question today is this: How useful is Android in segments such as point of service, industrial controls\/automation, automotive infotainment, utility monitoring, home automation\/security, portable ultrasound\/patient monitors, and more beyond?<\/p>\n<h3><strong>Linux made easy<\/strong><\/h3>\n<p>Let\u2019s first take a look at Android from the bottom up. It encompasses an operating system (OS), middleware, an application framework, a toolset and an open source community. The OS consists of a set of Android-specific patches on top of a Linux kernel. These patches add the Android vision for low-memory, power-sensitive processors by modifying the kernel\u2019s memory management, power management and inter-process communication (aka, its binder). Unlike traditional Linux where processes slowly starve as memory runs low until the \u2018out of memory\u2019 (OOM) killer activates, the Android kernel adds further intelligence by categorizing processes with respect to user importance.<\/p>\n<p>Processes in the least important group are killed to keep a system responsive. For example, the foreground user interface (UI) is likely to be of highest priority, though you can of course set these priorities according to your specific product requirements. Android also introduces the notion of \u201cWakeLocks,\u201d which supply power to particular peripherals, such as LCDs and backlights, and turns them off when they\u2019re not needed. Finally, Android\u2019s IPC driver\u2014binder\u2014is added to the kernel. Binder is a rewritten (thus Apache v2 licensed) and trimmed-down version of OpenBinder that provides resource sharing and assignment, and process management during runtime. It is this lightweight processor focus that turns a desktop-centric Linux kernel into an attractive embedded OS.<\/p>\n<p>The three recurring themes in Android middleware are Apache licensing, library breadth and the Dalvik Virtual Machine (DVM). Android has gone to excessive lengths to place the entire user space stack under an Apache v2 license, speeding its commercial adoption rate amongst those apprehensive about working with the GNU General Public License. Apache-licensed software can be integrated into proprietary projects without imposing the source redistribution requirements of \u2018copyleft\u2019 licenses like GPL.<\/p>\n<p>Bionic is Android\u2019s C runtime library. It differs from the widely used \u2018glibc\u2019 in that it lacks features like full \u2018pthread\u2019 and \u2018SysV\u2019 support. If you already have large glibc-compatible C libraries, there may be migration pains in moving to bionic, so you may choose to continue using glibc. On the other hand, bionic uses the very liberal BSD licensing scheme and is considerably smaller and slightly faster than its counterpart.<\/p>\n<p>In addition to the C library, Android comes with libraries for both 2D and 3D graphics, Web technologies, databases, multimedia and more. Instead of receiving a Linux base port from the silicon vendor and either paying a third party for a complete development file system or painstakingly assembling one yourself, the Android base port already provides this level of system integration.<\/p>\n<p>Every Android application runs in its own DVM, which in turn leverages the Android kernel patches for memory and process management. Unlike traditional virtual machines (which stereotypically perform poorly), the DVM was designed like the rest of Android to reduce the memory footprint by stripping duplicate constants, linking inline functions and using an optimized DVM instruction set (as opposed to Java bytecode). The DVM is also register-based and this can help to reduce the number of instructions and increase bytecode efficiency. Finally, the DVM was specifically optimized for multiple instantiations as most modern devices should be able to run multiple applications simultaneously.<\/p>\n<p>Android\u2019s expansive API provides the app developer access to a variety of hardware resources without forcing him or her to worry about their exact implementation. In fact, the Android SDK comes with an ARM simulator that runs on an x86 host to allow application development without specific hardware. And since Android shares Java\u2019s syntax and practices, application developers are widely available. Once applications are created, they can be moved across hardware platforms (and vendors) with relative ease. This lends itself well to the creation of scalable low-end and high-end products.<\/p>\n<p>This is a complete system that is ready to deploy if you only need to use the functionality provided by Android. The model works well if you do not want to choose among the almost-infinite open source options (and dependencies) available in a traditional Linux stack, or have the time or energy to migrate your applications with the rapidly evolving open source software underneath. However, it is likely that you have legacy system code to support or require software resources that are not provided in the Android stack. The Android Native Development Kit (NDK) allows C or C++ code to be built into native libraries to be run in the DVM and to be packaged into Android application packages (*.apk) for device deployment.<\/p>\n<p>Closely associated with Android is the notion of an \u201cApp Store,\u201d but this does not necessarily imply an iTunes-like experience. Android devices can have their own custom app stores launched by the hardware manufacturer, such as AppsLib from media player specialist Archos. Depending on the design, you may want end-users to be able to install their own *.apk packages as they become available online. For example, a home automation system user could download a weather app or a shopping list app according to his or her fancy. In this way, a device\u2019s software is no longer limited by your resources, but open to thousands of other applications just as you would expect in a desktop environment.<\/p>\n<p>Android has built-in checks to verify the app can be supported by the version of the platform installed on the device. In a more closed system, the store concept can be used to simply and safely upgrade or add features to units deployed to the field, such as POS terminals needing an updated SKU database or extra data field in the GUI. Conversely, if a device is Google-approved, users can download applications directly from the Android Market, which provides a full mobile phone experience.<\/p>\n<p>For most applications, the basic Android look and feel is advantageous as users highly associate it with a strong brand. But how do you take advantage of Android here if you want or need to retain a custom look? Custom branding has already occurred in cell phones, such as the HTC Droid Eris, which sports HTC\u2019s custom Sense user interface (UI) overlay. One way to achieve such customization is by leveraging commercial UI engines, such as Mentor Graphic\u2019s Inflexion software. It includes GUI builders and smooth integration on top of Android\u2019s native interface.<\/p>\n<p>Thus far, we have primarily viewed Android as a close relative to Linux with several advantages. How does it fare compared to Windows CE?<\/p>\n<p>They both provide single-source tooling\u2014that is, you can get your development IDE, compiler and debug tools from a single vendor. Of course, that is not to say that more advanced options are not available from third parties, but the point is that you can get to production without additional tools.<\/p>\n<p>Both Android and CE also provide application frameworks that enable massive numbers of application developers and allow for faster development time as less time is spent on middleware.<\/p>\n<p>However, their primary differences favor Android. Cost\u2014you can\u2019t beat free, both in per-seat development costs and runtime royalties. Licensing\u2014were you hoping to modify and redistribute source code?<\/p>\n<h3><strong>Let\u2019s start customizing<\/strong><\/h3>\n<p>If Android sounds appealing, let\u2019s review what you need to get started. First and foremost, you need an Android base port and a development board. Texas Instruments\u2019 OMAP35x product generation is particularly suited for Android with its high-performance Cortex-A8 GPU, SGX vector graphics accelerator, and C64x+ DSP, coupled with low power performance (Figure 1, p. 27).<\/p>\n<div class=\"article_figure\"><a class=\"figure\" title=\"Android Software Stack on OMAP3530&lt;br &gt;&lt;\/a&gt; Source: Texas Instruments\" href=\"\/edasource\/images\/72\/esd1004_ti1_large.jpg\"><img decoding=\"async\" src=\"\/edasource\/images\/72\/esd1004_ti1_medium.jpg\" alt=\"\" \/><\/a><\/div>\n<div class=\"article_figure\">\n<p class=\"figure_wrapper\"><span class=\"figure_title\">Figure 1<\/span><br \/>\nAndroid Software Stack on OMAP3530<br \/>\nSource: Texas Instruments<\/p>\n<\/div>\n<p>The OMAP35x family consists of four devices, with varying combinations of the SGX and DSP, thus allowing end-product scaling. For example, Android on an OMAP3503 can make use of ARM-side multimedia codecs, whereas an OMAP3530 can seamlessly utilize DSP codecs without changing any application level code. Similarly, an Android application on OMAP3525 can still render 3D OpenGLES graphics via ARM, whereas the flagship OMAP3530 would make use of the SGX vector graphics accelerator, again, hidden beneath the Android framework.<\/p>\n<p>Texas Instruments\u2019 OMAP35x family also includes a variety of development boards, ranging from TI\u2019s OMAP3530 Evaluation Module complete with a touch-screen LCD to the low-cost BeagleBoard at only $149 (Figure 2). The BeagleBoard has attracted a large community of developers with projects ranging from SDR to license plate recognition, available at beagleboard.org. An Android base port for OMAP35x is available at <a href=\"http:\/\/www.arowboat.org\">www.arowboat.org<\/a> and includes the complete source code as well as documentation to start your development. To recap, the full OMAP35x family is shown in Figure 3.<\/p>\n<div class=\"article_figure\"><a class=\"figure\" title=\"The OMAP35x processor family&lt;br &gt;&lt;\/a&gt; Source: Texas Instruments\" href=\"\/edasource\/images\/74\/esd1004_ti3_large.jpg\"><img decoding=\"async\" src=\"\/edasource\/images\/74\/esd1004_ti3_medium.jpg\" alt=\"\" \/><\/a><\/div>\n<div class=\"article_figure\">\n<p class=\"figure_wrapper\"><span class=\"figure_title\">Figure 3<\/span><br \/>\nThe OMAP35x processor family<br \/>\nSource: Texas Instruments<\/p>\n<\/div>\n<div class=\"article_figure\"><a class=\"figure\" title=\"BeagleBoard, a low-cost development kit&lt;br &gt;&lt;\/a&gt; Source: BeagleBoard.org\" href=\"\/edasource\/images\/73\/eda1004_ti2_large.jpg\"><img decoding=\"async\" src=\"\/edasource\/images\/73\/eda1004_ti2_medium.jpg\" alt=\"\" \/><\/a><\/div>\n<div class=\"article_figure\">\n<p class=\"figure_wrapper\"><span class=\"figure_title\">Figure 2<\/span><br \/>\nBeagleBoard, a low-cost development kit<br \/>\nSource: BeagleBoard.org<\/p>\n<\/div>\n<p>In addition to the Android base port, you will need the Android SDK itself for application development, available from developer.android.com. The SDK is available on Windows, Mac OS and Linux hosts. The latest SDK is version 2.1 and is associated with the \u00c9clair branch, whereas the previous 1.6 version was related to the Donut branch.<\/p>\n<p>Each SDK adds features. Some of the more interesting ones to emerge recently include HTML5 support for browsers, gesture input and builder, and text-to-speech. In addition to the SDK needed for application development, you may also want the Android Development Tool (ADT) plug-in for Eclipse, which turns your IDE into an Android GUI builder, Android application debugger and Android application signing utility. With the ADT, Android applications can easily be compiled and then run on emulators or hardware connected via USB or Ethernet with a few simple mouse clicks.<\/p>\n<p>Android can take the complexity and cost out of almost any design, whether it is a doctor\u2019s portable patient chart system or a next-generation vending machine. It comes with a complete development stack right out of the box so there is no need to be a GPS, graphics, or browser expert to be able to use them. By standardizing a simple API, your applications become portable across platforms and hardware and are insulated from rapidly changing open source software underneath. So make Android your next \u201cone stop shop\u201d for effortless system integration, painless user-interface and trouble-free development.<\/p>\n<p><em>Texas Instruments Inc.<br \/>\n<\/em><em>Product Information Center<br \/>\n<\/em><em>13532 N. Central Expressway<br \/>\n<\/em><em>M\/S 3807<br \/>\n<\/em><em>Dallas<br \/>\n<\/em><em>TX 75243-1108<\/em><\/p>\n<p><em>T: 1 972 644 5580<br \/>\n<\/em><em>W: <a href=\"http:\/\/www.ti.com\">www.ti.com<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The article compares Google\u2019s Android platforms to existing Linux builds, licensing regimes and the Windows CE operating system, and also describes how potential users can start to leverage existing hardware and software development kits and tools.<\/p>\n","protected":false},"author":229,"featured_media":773,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[321,1240],"tags":[335,345,359],"coauthors":[329],"class_list":["post-521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded-software-special-edition","category-embedded-development-platforms","tag-android","tag-linux","tag-open-source","workflow-historical","workflow-technique","organization-texas-instruments"],"_links":{"self":[{"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/posts\/521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/users\/229"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/comments?post=521"}],"version-history":[{"count":0,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/posts\/521\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/media\/773"}],"wp:attachment":[{"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/media?parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/categories?post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/tags?post=521"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.techdesignforums.com\/practice\/wp-json\/wp\/v2\/coauthors?post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}