Thursday, February 23, 2012

Android Builders Summit Videos

The Linux Foundation has posted the videos for the Android Builders Summit. You can find them all here:

http://video.linux.com/categories/2012-android-builders-summit

OTA Updateing via Android

One of the hardest problems that embedded Linux companies have to solve is updating devices. Given the changing nature of software, and the desire to include new features on existing products, being able to update devices in the field can be a critical feature. While Linux has some great tools (dpkg with apt, rpms, etc) for updating systems, the standard desktop features do not apply very well to embedded systems.

The Android platform is distributed with some great tools to update devices in the field. These tools range from package updates to full system updates. Generally this is called Over The Air (OTA) updates. There isn't a lot of information available on this topic. One of the clearest presentations I have seen on this topic was at the Android Builders Summit. Andrew Boie from Intel gave the presentation and the video and slides are now available. I highly recommend them.

http://video.linux.com/videos/android-ota-software-updates

One of the problems I noticed as I attended this session though was that it appears the update process has at least some dependency on a user interface. Obviously, with headless Android systems that poses a problem. One of the things that needs to be answered from an OTA perspective is what would need to be modified for an OTA process to complete without a user interface.

Building Your Favorite Glibc App for Android

There are a lot of great applications built on glibc that embedded Linux developers have made the mainstay of building embedded Linux systems. Among these are busybox, wget, cron, thttpd, and many others. The question is, can you get these to run under Android?

The answer is yes! (and no). Technically it would be a LOT of work to port these to use bionic, the c library that Android uses. However, nothing in Android restricts you from adding a standard glibc to your distribution and then using it with the standard programs.

Karihm did a great presentation on this at the Android Builders Summit. He showed an example of building busybox and adding glibc to the system. You can download his slides here: (a video of the presentation will be coming soon.)

https://events.linuxfoundation.org/images/stories/pdf/lf_abs12_yaghmour_heritage.pdf

Another option is to statically compile your binaries with the libraries that they would normally find on a glibc based system. The problem with statically compiling is that it pulls in all the code from the libraries that the code needs directly into the binary. If you have more than one program you are going to do this to, however, you would be better off building against the library. Busybox, which is usually just a few hundred K ends up being 2 MB if it's statically linked.

As the post about Ubuntu on Android shows, this is a great way to have your cake and eat it too.

Wednesday, February 22, 2012

Ubuntu for Android

An interesting new development effort by Canonical has Ubuntu running in parallel with Android on a multi-core phone. When you dock, you get Ubuntu's desktop on a monitor, while the phone still looks and acts like Android.


http://www.ubuntu.com/devices/android

Very cool stuff! Not really headless related, per se, but having Ubuntu fully run on the Android kernel and have glibc and the Ubuntu UI in all it's glory sitting on a phone definitely proves a point that this convergence of technology is where the future is headed.

Tuesday, February 21, 2012

Slides from Android Builders Summit

The slides from the Android Builders Summit are now available from the Linux Foundation site. You can find them all here:

https://events.linuxfoundation.org/events/android-builders-summit/slides

I recommend the following for anyone interested in Headless Android type applications.

- Leveraging Linux's History With Android by Karim Yaghmour, Opersys
- Customizing Android by Marko Gargenta, Marakana
- Using Android outside the Mobile Phone Space by Jason Krinder & Khasim Syed Mohammed, TI
- Android Device Porting Walkthrough by Benjamin Zores, Alcatel-Lucent
- Android OTA SW Updates by Andrew Boie, Intel

The folks at the Linux Foundation will be posting the videos from those events soon, so stay tuned for more information.

Saturday, February 18, 2012

Androgenizer - A tool for converting autotools makefiles

One of the things that Android developers have wanted to do for a while was to take standard C/C++ applications that are generally used in standard embedded Linux systems and use them in Android. There are a couple of ways this can be accomplished, but for those larger systems converting the Makefiles into something that Android can use natively in a build has been a problem.

Some creative folks came up with a solution. Androigenizer. It takes autotools generated infrastructure and creates Android.mk files.

Here is a good write up on it from Igalia's blog.

http://blogs.igalia.com/eocanha/?p=242

It's a good resource for headless Android systems.

Friday, February 17, 2012

Headless Android Website

I just got the Headless Android website up. Check it out. It's mostly a landing page to get back to this blog, but it will be a nice place to post more static data over time.


http://headlessandroid.com

Thursday, February 16, 2012

Why Headless Android?

I have been asked several times, “What is the point of headless Android?” It’s not hard to see why the question is asked. Android, in essence, is a specialized user interface for a phone or tablet platform that runs on the Linux kernel. The Android development team has done a fantastic job to create a platform that application developers can build great apps for phones and tablets. Because they focused on the platform under the applications, just as much as they focused on the applications themselves, the Android team also developed a world class platform framework.

For some, using headless Android comes down to commonality. If you have development efforts where you have two products (for example), one with a UI and one without, then keeping those platforms consistent from a development stand point just makes sense. Being able to write code that you can share between the two platforms is essential for maintenance.

While that use case is an interesting one, it is by no means (in my opinion) the biggest reason developers should care about headless Android. I’ll tell you why.

Five years ago, if you asked just about any embedded developer what they were going to use as the operating system for their embedded hardware (with or without a UI), most of them would say Linux. It was a smart choice. Having control of your destiny (so to speak) can be absolutely critical to the success of a project, especially if you aren’t one of the 800 pound gorillas. For smaller companies building embedded devices, Linux offered the freedom to succeed despite the common road blocks that often beset embedded projects. For example, if I have access to the kernel source, I can debug that lousy DMA controller bug that is preventing my audio from working. It was a wonderful world, if you liked that sort of thing.

Fast forward to today. While embedded Linux is still a fantastic choice for embedded devices, more and more companies are looking for ways to improve over the roll-your-own custom Linux environment that most embedded Linux developers work in. Sure, there are companies that build BSPs that have common utilities and libraries, but that can only get you so far.

Enter Android. For phone developers it is like what embedded Linux was to embedded developers ten years ago. A boon! Finally a widely popular development environment that included an Integrated Development Environment (IDE), a great set of debugging tools, a rich set of off-the-shelf libraries, and a killer user interface. PLUS, you can modify it to your hearts content. Power to the programmers!

As a non-phone developer and embedded Linux fanatic, I have to admit that for phones Android is great, but what about all the millions of devices that aren’t phones, and for that matter aren’t tablets, and may not even have a user interface? With a bit of work, those of us not doing phones can have our cake and eat it too...

There are three reasons I believe headless Android will catch on in popularity as more developers begin to use it.

1. Development Tools - Having an IDE and graphical debugger that “just work” with an easy way to deploy, test, debug, and package your software is a huge time saver.

2. The Platform - Leveraging the built in Android system services architecture can save a huge amount of time and effort. Built in IPC, memory management, service “keep-alive” code, and package management also saves a lot of time and effort. Every embedded devices needs most, if not all of these things, so leveraging a system that is already proven has huge advantages.

3. Knowledge - Since Android is a popular platform, there is a growing community of knowledgeable software engineers that understand the in’s and out’s of the system. Training someone on a roll-your-own solution can take months. Leveraging a known platform can dramatically increase productivity. Along with this the number of books and websites devoted to Android is growing all the time.

There are many other reasons for utilizing the platform offered by the Android system. Why reinvent the wheel? Especially when the wheels work so great and come with tires, axles, and a power train?

Cyborgstack

One of the interesting things I picked up from the Android Builders Summit was a project that Karim Yaghmour of Opersys started to make a completely open Android distribution. The point of the project is to open Android up to the many other markets that may want to use it.

I will be sharing the patches for the headless Android work that I've been doing with the Cyborstack project, so there will be a good repository that everyone can get to. Given that I work in an industry that isn't related to phones or tablets in any way, I'm excited to have a group of people looking at what I'm looking at.

Take a look at it and see what you think.

Cyborgstack

Wednesday, February 15, 2012

Karim's Post on Headless Android

Karim posted on Headless Android. You can see his post here:

http://www.opersys.com/blog/headless-android-1

Karim Yaghmour's Headless Android Presentation

The highlight of the Android Builders Summit (ABS) for me was Karim's session on Headless Android (that was probably pretty obvious.) He gave a great presentation on actually stripping out all the stuff that depends on the UI, like the WindowManager and SurfaceFlinger.

He showed a running system with his modifications with no UI and it was a beautiful thing. When I saw the code running, I got a tear in my eye and started asking if anyone had a tissue!

With Karim's permission, I'm posting a link to his presentation.

Headless Android Slides from ABS

The folks at the Linux Foundation that hosted ABS will have the presentations and videos up by Monday on their site. I'll post links when they show up.

If you want to download the git repository with the headless android changes that Karim did, then here are the commands:
$ repo init -u git://github.com/cyborgstack/android.git -b headless
$ repo sync
 
I wanted to thank Karim for his work on this front!