Demo Projects

Loading...

Tuesday, July 24, 2012

Raspberry Pi runs Android for the first time in history

Porting Android on Raspberry Pi so that we can transform our TV into a big Android tablet or a connected cheap Google TV? This is a dream of many Raspberry Pi owners. Needless to say, if this can be realized, it will be a cool Smart TV device, even cheaper than the popular MK802 Android Mini-PC!

Despite the great technical difficulties and failures, after being discussed thousands of times, for the first time in history, the porting has been proven to be successful.

An image based on Cyanogenmod 7.2 version of Android 2.3 has been successfully cooked for Raspberry Pi.
It really runs, slowly, but runs! Here is a video of how it works in action:


This is pretty much smoother than the previous CM9 version two days ago.

Hackers from both the Raspberry Pi and Android communities are trying to add hardware acceleration to create faster and more usable images.

Download the image here and flash it into an SD card, exactly the same way as we flash a normal Debian image for the Pi:
https://docs.google.com/open?id=0B2qw32upVDnkT0JXNkoyY1hSOUU
Android Pi Wiki:
http://androidpi.wikia.com/wiki/Android_Pi_Wiki
Raspberry Pi Forum Page:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=56&t=8780

Saturday, July 14, 2012

ADK 2012 for Android

Despite the popularity of the IOIO board for Android (a tool for adding external hardware to Android devices), which has the largest developer/hacker community, Google does not abandon its Accessory Development Kit (ADK). At Google I/O 2012, the team made another demo of ADK, using another board different from what we saw (or used) last year.



ADK 2011:



This time, you get some serious design:

ADK 2012:


The new Audio dock API and HID API seem to be the main interests of this ADK 2.0, which are very easy to implement.


The entire project is open-source as usual. If you want to make your own ADK 2012 board, please get the schematics and source code here:
http://developer.android.com/tools/adk/adk2.html#src-download

Once you get your ADK board, you can play with it using the official application available in the play store:


ADK 2012: https://play.google.com/store/apps/details?id=com.google.android.apps.adk2
ADK 2011: https://play.google.com/store/apps/details?id=com.diyphonegadgets.DemoKit


For example, for those of you who want to make an external audio dock for Android that is able to play audio over a USB connection, simply grab a device running Android 4.1 (API Level 16) or higher (e.g., Galaxy Nexus), prepare your ADK 2012 board, open your favorite Arduino IDE, and start your pleasant development now.

The ADK 2012 provides a reference implementation of this functionality for accessory developers. No software application is required to be installed on the connected Android device, accessory developers only need to support AOA v2. This implementation demonstrates audio output of 16bit, 44.1kHz stereo PCM source data compressed into a single channel due to the audio hardware available on the accessory.

Using the audio output features provided by the ADK library requires only a few function calls. The first few calls are in the accessory setup() routine, which prepare the accessory for USB connections and audio output, as summarized in the code example below:

ADK L;
void setup() {
  L.audioInit();
  L.usbh_init()
  L.usbStart();
}

For more information about the ADK::audioInit() function, see the libraries/ADK/Audio.c library file. For more information about the ADK::usbh_init() function, see the libraries/ADK/Usbh.c library file.

After completing this setup, the loop() function calls ADK::adkEventProcess() to handle audio output and other ADK functions:

void loop(void)
{
  ...
  L.adkEventProcess(); //let the adk framework do its thing
  ...
}

This call executes task queuing for the ADK and as part of the execution process, the task queue executes usbh_work() inlibraries/ADK/Usbh.c, which handles audio output requests. Review the implementation of this function for details. For additional implementation details on audio output, see the libraries/ADK/accessory.c library file.

Enjoy the official presentation here:


Disqus for DIY Phone Gadgets