Blog: [Blog Home] [Archives] [Search] [Contact]

Posts Tagged ‘tablet’

A Simple Android Processing Painting Sketch

Thursday, June 13th, 2013

Processing Android Painting App
Processing Android Painting App

The Coursera class Creative Programming for Digital Media & Mobile Apps started this week and it’s been quite a challenging week. Not because of the course content. The challenge has been getting Processing to work in Android development mode in conjunction with the Android SDK and my Samsung Galaxy Tab 2 tablet. The class forums are besieged with posts from people trying to get all these parts to work together. It took some doing but I did get everything working and wrote my first Android app – a simple painting program. The illustration above is a screen shot of the app in action. The app also plays music while drawing – as opposed to playing continuously.

My Processing Android Installation

I am developing using the just released version of Processing (PROCESSING 2.0 (REV 0218) – 3 June 2013) on a Windows 7 platform and using a Samsung Galaxy Tab 2 as my Android tablet. This is relevant because the path to success depends on your particular mix of operating system, Processing version, and Android tablet type. Here are the steps I took to get everything working for my development environment.

1 – Install Processing 2.0, Revision 0218

Installing the 32-bit version of Processing went off without a hitch. I started Processing and created a couple of test sketches to insure that this piece worked.

2 – Use Processing’s Add Mode tool to add the Android and Javascript operating modes.

Abject failure. It turns out that this new release of Processing has a bug in it such that this tool may or may not work. The Add Mode step is necessary if you want to use Processing to develop apps.

2b – Manually add the Android mode

I manually downloaded the Processing Android development library from
The big question was where to unzip it. The instructions said ‘in the modes directory’ but I had more than one. I tried adding it to the ‘canned’ locations people were recommending but those didn’t work for me. If I had done it right Processing would have recognized the library’s existence and added it to its modes options list.

The reason the canned solutions did not work for me is because I had specified my own directory for Processing to use as its Sketchbook library. When I did this, Processing automatically (and without telling me) created a modes subdirectory in that directory. That is the modes directory in which Processing will look for the libraries. So if you’re a Processing user and want to know where your modes directory is, go to File -> Preferences and look at the entry for the Sketchbook location to see where this is on your computer.

At this point, Processing now had an Android mode but when I tried to use it, Processing told me that it didn’t know where my Android SDK was. Note that at this point I had not even installed it.

3 – Install the Android SDK

I installed the Android SDK and next using the SDK Manager downloaded and installed a variety of packages. I then restarted Processing and upon entering Android mode told Processing where I had installed the Android SDK. Processing stores this path in your preferences.txt file, in my case as:
android.sdk.path=C:\Program Files (x86)\Android\android-sdk

I now tried to run a sketch in emulator mode (Sketch -> Run in Emulator) but bailed after staring at a "Waiting for device to become available" message forever. What to do?

3b – Re-Install the Android SDK

I uninstalling the Android SDK and started over from scratch. Only this time I used the instructions found here:
on how to install the Android SDK. Note that the installation of the SDK takes a long time to complete so be sure to have something to do to keep yourself occupied while the install runs its course.

At the conclusion of this process, I had an Android SDK with the following packages installed:

  • Tools:
    • Android SDK Tools
    • Android SDK Platform-tools
    • Android SDK Build-tools
  • Android 4.2.2 (API 17)
    • Documentation for Android SDK
    • SDK Platform
    • Samples for SDK
    • ARM EABI v7a System Image
    • Google APIs
    • Sources for Android SDK
  • Android 2.3.3 (API 10) SDK Platform
  • Extras: Android Support Library
  • Extras: Google USB Driver

I went back to Processing and again tried to run a sketch in Emulator mode. Success! But be forewarned – the emulator is slow to get going. The first time I bailed as I was still getting the "Waiting for device to become available" message. It turns out I was just not being patient enough. The second time the emulator window finally showed up and after waiting some more, my sketch started running in the emulator.

4 – Running the Sketch on my Tablet

Now it was time to try and run my sketch on my Android tablet (Sketch ->Run on device). The first thing I did was go into my tablet’s settings and set the Developer Options -> USB Debugging to ‘checked’. I plugged my tablet into my laptop and in Processing hit the Run button. Note that Processing defaults to running your app on the attached device. After going through the compilation stage I was once again seeing my old friend: "Waiting for device to become available". Now what? I was patient but realized that my patience was not going to pay off when the message "Lost connection with device while launching. Try again." showed up.

One step in the troubleshooting process was to make sure that the AndroidManifest.xml file for my sketch contained the following line: "android:debuggable=”true”" in the application section – it did.

Going back through documentation I saw that there was one thing I had neglected to do.

5 – Install Device Drivers for my Galaxy Tab Tablet

The reason Processing couldn’t talk to my tablet was that I’m using Windows and if you are on the Windows OS you need to download and install USB drivers from your tablet’s manufacturer that can then be used by the Android SDK (ADB). I found the information on this part of the process here:

So it was off to find the downloads page for my tablet on the Samsung web site. You won’t find any reference to USB drivers there but you will find the Kies software package that runs on your PC and gives you the ability to manage your tablet. For example, this is the software you would use to install firmware updates on your tablet.

The Samsung Kies install takes some time to complete. In fact it is even slower than the Android SDK installation process. Additionally, on starting up Kies it told me that a newer version was available! So I had to go through a time-consuming update. I was told by a Samsung rep that the Kies software that people download from the Samsung web site is not kept up to date so everyone downloading Samsung Kies will encounter this need to update.

Getting the Samsung Kies software to talk to my Galaxy tablet required some troubleshooting which involved Kies reinstalling its drivers and rebooting. Having gotten Kies to connect with my tablet, I took the opportunity to update my tablet’s firmware.

At this point, rather than continue with the installation instructions previously referenced, I gambled. I started Processing and tried to run a sketch without completing the steps about installing the USB drivers.

Success! Processing connected to my tablet, downloaded the sketch, and the next thing I know I’m finger painting.

My Processing Android App Plans

Now that I’ve gone through all this pain to write and run Android apps, what am I going to do with this capability? That’s a good question. According to the Creative Programming for Digital Media & Mobile Apps course outline, the topics that will be covered are:

  • Week 1: Introduction: sonic painter
  • Week 2: Interactive D/VJ app
  • Week 3: Music player and sensor controlled visualiser
  • Week 4: Game with physical modelling and synthesis
  • Week 5: APIs accessing and processing social media data
  • Week 6: Music machine

Obviously I’m going to write apps that satisfy the course requirements. But beyond that I have no plans for developing Android apps. Rather I am primarily interested in using this class as a source of new ideas for digital creativity. But who knows – by the end of the course I may have a different perspective.

Happy computing, Jim

Bookmark it:  Stumble It  Bookmark this on Delicious  Digg This  Technorati  Reddit Tweet It

New Wacom Tablet: Intuos4

Saturday, March 28th, 2009
Wacom Intuos4
Wacom Intuos4 Medium

Wacom has just released its new line of pen tablets – the Intuos4.  From the product write ups it looks like it might be time for me to upgrade. I currently use an Intuos2 tablet with my desktop for all my “real” graphics work. My Intuos2 was an upgrade from an older, smaller Graphire tablet which I still use on occasion with my laptop at home and when traveling.

I must say that once I started using a pen and tablet combination for my graphics work, any time I went back to use my mouse it seemed like a giant leap backward. For the Intuos4 it looks like the biggest advances have been made in the areas of pen sensitivity and responsiveness – the very features that attracted me to the Wacom tablet in the first place. If you have never used a pen and tablet in your graphics work, take this test. First, with a pencil and paper write in cursive your signature. Then, with the paint program of your choice, write your signature using your mouse. You will see that your mouse-created signature is no where near as smooth or as natural looking as your pencil and paper signature. Writing using a tablet and pen is very much like writing using traditional media. While not as versatile as a traditional paint brush, the Wacom pen is as close as you can come digitally.

I am not going to go into a detailed list of the Intuos4 features – there is a good summary of the features at the Amazon Wacom Intuos4 Medium Pen Tablet product page.

Once you’ve bought your Intuos4, you will be able to download several pieces of software that come bundled with the product. The software consists of the following two plugins for Photoshop:

  • Nik® Color Efex Pro™ WE6
  • Wacom Brushes 3.0 for Photoshop

and your choice of two of the three following software packages:

  • Adobe Photoshop Elements 7 Windows or Adobe Photoshop Elements 6 for Macintosh
  • Autodesk SketchBook Express® 2010
  • Corel Painter Sketch Pad

Given that I already have the full blown versions of Photoshop and Painter, I would download SketchBook. While I wasn’t able to find any information about Autodesk SketchBook Express 2010, I did find the following about SketchBook Express 2009.

Back to the Intuos4, it is available in four sizes (dimensions given are for the active area):

The size of my Intuos2 puts it somewhere between the size of the Medium and Large Intuos4. Based on that I will probably upgrade to the Wacom Intuos4 Large Pen Tablet as it is somewhat larger than my Intuos2 and is just over $300 cheaper than the Wacom Intuos4 Extra Large Pen Tablet. Also, the footprint of the Large is a manageable 18.7 x 12.6 inches whereas the Extra Large consumes a hefty 24.5 x 18.2 inches of desktop space.

Only one question remains: when I upgrade to an Intuos4, what will happen to my old but trusty Graphire since my Intuos2 will be reassigned to laptop service.

Ad Astra, Jim

Bookmark it:  Stumble It  Bookmark this on Delicious  Digg This  Technorati  Reddit Tweet It