Skip to main content

Developing for Android on Fedora 14 using the T-Mobile myTouch 4G - Step 1L, Setup

Back in mid-February I wrote about setting up the Android SDK to support Android development with the myTouch 4G. The Android SDK was installed on Windows XP SP3+ on my Dell Latitude D630. Since that first post, I've picked up a new Latitude E6510 with Windows 7 Enterprise 64-bit installed and the D630 has been provisioned with Fedora 14 64-bit.

When I moved up to Windows 7 I moved my Android development environment up to Windows 7. I had no problems moving from a 32-bit Windows environment to a 64-bit Windows environment that was two generations more evolved. Everything installed just fine, including the USB driver for the myTouch 4G.

With Fedora 14 installed and working to my satisfaction, I decided to see how much trouble it would be to duplicate the Android SDK work environment on Fedora, and then make some simple comparisons between the two. I also wanted to finally expel the ghost of Maemo. The development environment for Maemo was, in a word, horrible. The Android SDK (as well as Android) is light years ahead of Meamo, and it's not due to just the time between the two.

The first step is to realize that the Android SDK is 32-bit only. To run successfully on a 64-bit Fedora 14 installation I had to install these additional support packages:
  • glibc.i686 
  • glibc-devel.i686 
  • libstdc++.i686 
  • zlib-devel.i686 
  • ncurses-devel.i686 
  • libX11-devel.i686 
  • libXrender.i686 
  • libXrandr.i686
I used 'yum install ' in the grubby old command line (i.e. the terminal) to do the dirty deed.

The next step is to download the Linux version of the Android SDK and unpack it somewhere in your home directory. For the purposes of this discussion I have a top-level directory in my home named Android, under which I unpacked the SDK and placed other Android tools. So on my Fedora system I have $HOME/Android. When the Android SDK is unpacked, I have $HOME/Android/android_sdk_linux_x86.

Before you run any SDK tools, you should add the following to your environment. Since I'm a basher, all of this will be in my .bashrc:
export ANDROID_HOME=$HOME/Android/android-sdk-linux_x86
Kill the current shell and start a new one to pick up the changes to .bashrc, then run 'android' to load all the bits you'll need for development. Once that's complete, you can start ddms and start to work with your attached Android phone (or other device).

So far everything has been fairly fast and painless. Running ddms is where the slow pain starts. I noticed that when I first installed everything and started ddms that the device showed up in device pane as unknown.

When I selected the device I got a nice dump, with the cryptic message "insufficient permissions for device." A bit of search via Google, and I came across what I thought was the solution in an Ubuntu forum.

According to the forum thread I needed to create a file called 51-android.rules in /etc/udev/rules.d. I ran lsusb to get the following information (with my Android phone plugged in):

Bus 002 Device 004: ID 0bb4:0c96 High Tech Computer Corp.

I then created this one and only line in 51-android.rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c96", MODE="0666"

Then, as root, I ran 'udevadm control --reload-list'

And none of that worked. I kept getting the exception. So I went back to Google and refined my search a bit and discovered this kludge in a forum devoted to Fedora. As root, I changed to the directory where adb is located (.../android-sdk-linux_x86/platform-tools) and I typed:

./adb kill-server
./adb start-server

I have a working solution for udev rules problem here. Read this later post and ignore the strike-through text above and at the end of this post.

Then as a regular user I re-ran ddms and voilà, it all worked as it should and I was able to see my Android smartphone.

Even screenshots.

I don't know what the exact problem is with USB device permissions, but the fact that, as root, I can coerce adb to handle it properly by restarting adb in this manner is A Clue. Once adb is restarted I can plug and unplug the smartphone until I shut down the notebook. And the Android smartphone doesn't have to be plugged in for this kludge to work.

In the mean time I have other fish to fry. I will eventually discover a more elegant and complete solution (or maybe I'll get lucky and somebody will tell me). In the mean time I have a 90% solution with a simple kludge that allows me to do a bit of Android development on Fedora.


Popular posts from this blog

A Decade Long Religious Con Job

I rarely write inflammatory (what some might call trolling) titles to a post, but this building you see before you deserves it. I've been seeing this building next to I-4 just east of Altamonte/436 and Crane's Roost for nearly 12 years, and never knew who owned it. Today on a trip up to Lake Mary with my wife I saw it yet again. That's when I told her I wanted to stop by on the way back and poke around the property, and photograph any parts of it if I could.

What I discovered was this still unfinished eighteen story (I counted) white elephant, overgrown with weeds and yet still under slow-motion construction. It looks impressive with its exterior glass curtain walls, but that impression is quickly lost when you see the unfinished lower stories and look inside to the unfinished interior spaces.

A quick check via Google leads to an article written in 2010 by the Orlando Sentinel about the Majesty Tower. Based on what I read in the article it's owned by SuperChannel 55 WA…

Be Careful of Capital One Mailings

Capitol One ("What's in your wallet?") sent me a bit of deceptive snail mail today. I felt sure it was a credit card offer, and sure enough, it was. I open all credit card offers and shred them before putting them in the trash. Normally I just scan the front to make sure I don't miss anything; the Capital One offer made me stop for a moment and strike a bit of fear into my heart.

The letter's opening sentence read:
Our records as of December 30, 2009 indicate your Capital One Platinum MasterCard offer is currently valid and active.Not paying close attention during the first reading, I quickly developed this irrational worry that I was actually on the hook for something important, but I wasn't quite sure what. The letter listed "three ways to reply" at the bottom; via phone, the internet, and regular snail mail. I elected to call.

Once I reached the automated phone response system, the first entry offered was '1', to "activate my Capital …

cat-in-a-box channels greta garbo

So I'm sitting at my computer, when I start to notice a racket in back. I ignore it for a while until I hear a load "thump!", as if something had been dropped on the floor, followed by a lot of loud rattling. I turn around and see Lucy in the box just having a grand old time, rolling around and rattling that box a good one. I grab the GX1 and snap a few shots before she notices me and the camera, then leaps out and back into her chair (which used to be my chair before she decided it was her chair).

Just like caring for Katie my black Lab taught me about dogs, caring for Lucy is teaching me about cats. She finds me fascinating, as I do her. And she expresses great affection and love toward me without coaxing. I try to return the affection and love, but she is a cat, and she takes a bat at me on occasion, although I think that's just her being playful. She always has her claws in when she does that.

She sits next to me during the evening in her chair while I sit in mi…