In interaction design we often use various physical and digital materials that we recombine in novel and interesting ways. Today we also carry around mobile devices that have many of the sensors, actuators and networking capabilities that are commonly used in interaction design, e.g. touch, vibration, accelerometer, gyroscope, thermometers, NFC, GPS, etc.
The goal for this first workshop is to get some hands on exploration with sensors on mobile devices. In this case we will focus on the magnetometer – the sensor that is used in compass apps. The Android Platform is well documented and particular information about the sensors API can be found HERE. It is based on Java compared to iOS (iPhone, iPad) which is based on Objective C.
In short we will try to do the following steps:
- Setting up the Android Developing Environment
- Creating a New Project and getting started
- Brief introduction to various Android project components
- Scanning the web for information about existing code for reading the magnetometer sensor (Hint: StackOverflow.com)
- Exploring ways of exploiting the magnetometer for direct input
- Modern debugging methods
- Group Exercises
Notes on Setup:
I tried to set up the Environment on my Mac and these were the problems I encountered. They would most likely vary depending on system and setup. For instance I already had JDE and Eclipse installed since I have programmed in Java before.
After installing the Android SDK I tried to create a new project (File->New->Android Project). In this case it could not find any build target’s so I had to point to the correct Android SDK folder in the preferences (Eclipse->Preferences->Android->SDK Location).
Then I tried to run the project and since I forgot to create an Android Virtual Device (AVD) it did not work. So in the AVD manager I set up a new device with screen resolution 240×320. I tend to always use API level 4 (Android 1.6) when possible. After starting the device and running the program again it fails once more. Looking at the error message in the Android Console window:
emulator: ERROR: the user data image is used by another emulator.
I have no clue. Copy paste into the search field at StackOverflow. Voila! Apparently there were two .lock files created that I need to delete. Finally the freshly created project is up and running.