OpenCV for Android by Erik Hellman

Notes from Erik Hellman’s talk about OpenCV for Android on the 1st day of DroidCon UK 2012.

Open source Computer Vision library, containing loads of modules and image (related) algorithms.

The code is very well documented, but most samples are in C++.

A couple of examples of what you can do with OpenCV are:

  • Object detection, i.e. face detection.
  • Salient feature detection, i.e. hand or a door frame.
  • Motion tracking.

The talk mainly covered demonstrations of what you can do with OpenCV, rather than going into more detail.

Library: Download OpenCV (for Android)
Documentation:  OpenCV API Reference

AllJoyn by Mitch Williams

Notes from Mitch Williams’ talk about AllJoyn on the 1st day of DroidCon UK 2012.

“AllJoyn™ is an open-source application development framework that enables ad hoc, proximity-based device-to-device communication that is OS agnostic.”

There are other frameworks like DLNA, UPnP and Bonjour as well. DLNA would be a good choice if you only wanted to do one-to-one device communication. UPnP and Bonjour are missing a lot of the higher level communication compared to AllJoyn.

AllJoyn is multi-platform as a result of the native implementation being written in C++. The currently supported platforms are:

  • Android 2.1 and above
  • iOS
  • Window XP, 7 and 8
  • Linux
  • OS X

Source code: AllJoyn @ Github.
Documentation: AllJoyn Java docs.

Introduction to Polaris by Cyril Mottier

Notes from Cyril Mottier’s talk about Polaris on the 1st day of DroidCon UK 2012.

Polaris is a mapping library for Android. It was created because with the current Google Maps API it is painful to even do simple stuff.

Some features of Polaris include:

Gesture support

  • Simple tap (opens a call out)
  • Double tap (zoom in or zoom to the maximum zoom level for the location)
  • Long press

(Map) Annotations with a “variable anchor” (the arrow/pointer of the annotation is dynamically placed based on the location’s position on screen).

Demo: Polaris Sample @ Google Play Store.
Source code: Polaris @ Github.

NOTE: Polaris may become obsolete as Google is working on a new Maps API for Android.

DroidCon UK – day 2

Another quick summary of the talks of the day.

9.45 The Fragment transition
Who: Corey Leigh Latislaw
What: Introduction on using Fragments.
Web:
Summary: Start using Fragments now. There is no need to convert a whole app at once, but you can start using Fragments with the new Activities you are building.

10.30 Writing games for an Android console.
Who: All Sutton – Ouya
What: Some considerations to keep in mind when developing for a console.
Web: www.funkyandroid.com
Summary: Developing for a console is wildly different from mobile.

11.30 Android reverse engineering
Who: David Tellebaum – apkudo
What: Reverse engineering Android applications.
Web: www.apkudo.com
Summary: Hacking Zynga’s “Words With Friends” using (bak)smali and ViewServer.

12.15 Interfacing hardware with Android and Arduino
Who: Fei Manheche – Robobo
What: Connecting Android apps to Arduino hardware.
Web: www.robobo.org
Summary: A brief introduction on how to make Android and Arduino talk to each other.

14.00 Memory Analyzer
Who: Felipe Ferraz – CESAR
What: Memory analyzing to resolve bugs and optimize performance.
Web:
Summary: Using a timeline of memory dumps and the MAT Eclipse plugin to resolve bugs and optimize performance.

14.45 Deep dive into Android custom components
Who: Chui-Ki Chan – Monkey Write
What: Creating your own custom components.
Web: www.sqisland.com
Summary: Easily create your own custom components by either encapsulating or extending existing widgets. Slides: www.bit.ly/DeepDiveComp

15.45 Optimized network communication
Who: Erik Hellman – Sony Mobile
What: How to optimize your networking logic to provide user-friendly and power-efficient experiences.
Web:
Summary: A set of tips and best practices to avoid annoying the user and not drain the battery with networking activities.

16.30 Dynamic Animations
Who: Anders Ericsson – jayway.com
What: Dynamic animations.
Web: www.jayway.com
Summary: By extending a View, adding a custom class to calculate position (using spring and damper physics) and using a Runnable you can quickly add animations to any View.

17.15 AndroVM
Who: Daniel Fages – Genymobile
What: An Android VM that runs on VirtualBox.
Web: www.androvm.com
Summary: An explanation about how AndroVM is built followed by a demo.

18.00 Developing accessible applications
Who: Gary Readfern-Gray – RNIB
What: Developing accessible applications for Android.
Web: www.rnib.org.uk
Summary: It takes very little effort to add basic accessibility optimizations by using content descriptions for widgets and making the app navigable by keyboard (or at least D-pad).

DroidCon UK – day 1

A quick summary of the talks of the day.

10.05 AllJoyn
Who: Mitch Williams – Qualcomm
What: AllJoyn P2P framework
Web: www.alljoyn.org, www.alljoynappchallenge.com
Summary: An ad-hoc and proximity based p2p framework.

10.40 Device fragmentation
Who: Robin Puthli – Itude Mobile
What: Mobile device fragmentation
Web: www.itude.com
Summary: Fragmentation is an old problem. “There is no silver bullet. You have to pick and mix [from the available solutions].”

11.15 Unify VoIP / MSG Core
Who: Martyn Davis – Voxygen
What: Unify VoIP / MSG Core
Web: www.voxygen.co.uk
Summary: A paid for VoIP library written in C, using JSON messaging. Available for Android and iOS.

11.50 Polaris
Who: Cyril Mottier – Prixing
What: An introduction to Polaris
Web: www.github.com/cyrilmottier/Polaris
Summary: A (Google) maps library for Android. Adding a lot of useful features.

13.25 Gradle
Who: Lukas Jarosh – And labs ?
What: Gradle
Web:
Summary: Gradle, a less verbose Maven alternative.

14.30 OpenCV
Who: Eric – Sony
What: OpenCV library
Web: www.opencv.org
Summary: Open source Computer Vision library, containing loads of modules and image (related) algorithms.

Hardware accelerated Android emulator

A little gotcha when you “install” the “Intel Hardware Accelerated Execution Manager” using the SDK manager, it isn’t actually installed and/or enabled. You need to do a little bit more:

  1. Install Extras/Intel Hardware Accelerated Execution Manager using the “Android SDK Manager”
  2. Make sure “Intel x86 Atom System Image” in “Android 4.0.3 (API15)” is installed through the “Android SDK Manager” as well.
  3. Really install hardware acceleration by running [Android SDK folder]\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe
  4. Update virtual device to use hardware acceleration in “AVD Manager”:
    – Set “CPU/ABI:” to “Intel Atom (x86)”
    – Under “Hardware”, add a new property “GPU Emulation” and set the value to “yes” (default is “no”).
  5. All done! Your hardware accelerated emulator is ready to launch

Note: Might not work with some libraries using JNI when they are built for ARM only.

Using Android hardware devices on Ubuntu

I’ve been working on some Android applications lately and switched to Ubuntu for this. It took a while to figure out how to set up USB debugging on Unbuntu, but the steps below worked nicely for me.

  1. sudo vi /etc/udev/rules.d/51-android.rules
  2. For each vendor add: SUBSYSTEM==”usb”, ATTR{idVendor}==”0bb4″, MODE=”0666″, GROUP=”plugdev”
  3. chmod a+rx /etc/udev/rules.d/51-android.rules
  4. sudo restart udev
  5. adb devices (your phone should be listed there)

(Tested on Ubuntu 11)