Advanced Topics in Mobile Computer Vision (EECS 598-07) - Fall 2010

Instructor: Prof. Silvio Savarese

Webpage: http://www.eecs.umich.edu/~silvio/

Classroom:3433 EECS
Time: T Th 9:00am-10:30am
Office hours: by appointment

Android Development

 

 

Developing Environment Setup

Click the links for details
  • Android SDK: Including Java, Eclipse, Android SDK
  • Android NDK: For running C code on Android
  • Apache Tomcat: For the server setup, assuming you have installed Android SDK. You can certainly use your favourite programming language or server software to the server side development

Demo Code For Android Develoment

The code is used in the Android development demo lecture

Sample Code

The code is for illustration purpose. You can play around with it.

Useful Tips

More tips are welcome

UNIX API in NDK

Although only a small set of UNIX API is officially supported in the native code, you can still use a lot of linux API if you really need it. You can find a list of all the API available on Android 2.2 here

Read raw data of an image on Android

You can use Btmap to read an image and then extract the raw data from the Bitmap. The sample code below assumes you put the image in <project_root>/res/drawable/ floder and you are in an activity class.

// Get current resource reference from the member
// function getReources of Activity
Resources res = getResources();
int imageWidth = 0;
int imageHeight = 0;
// Read the image
Bitmap image = BitmapFactory.decodeResource(res, R.drawable.image);
imageWidth = image.getWidth();
imageHeight = image.getHeight();
// Allocate memory for the raw pixel data
int [] pixels = new int[imageWidth * imageHeight];
// The pixels read is in ARGB format image.getPixels(pixels, 0, imageWidth, 0, 0, imageWidth, imageHeight);
For more information about Bitmap, you can check its document.

Use OpenCV library on Android

The project is hosted here with good document

Take screen capture of Android phone on Computer

You can use DDMS shipped with Android SDK to connect to Android phone and capture a screenshot.

To use DDMS, find the folder of Android SDK and in the tools/ folder, you can find ddms. You can launch this Java program directly. When the application is ready, select your phone and in the menu, click device->Screen capture. Then you can capture the sreen of Android phone.

Also, you can launch DDMS within Eclipse. In the menu, click Window->Open Perspective->DDMS. In the DDMS view, select your Android phone and click the screen capture button around the upper right corner.

Activate Droid 1 Without Contacting Verison

If you can't activate your Droid 1 through Verison, you can still use the phone without service, which is enough for our purpose. The instruction is here