Android Adventures
I finally got a smartphone: Samsung Captivate. Why? Mainly since the bar for making apps on them seems pretty low, which is something I’ve wanted to try for some time. Plus after seeing these two posts…
And their reference to Processing For Android…
…and considering my love for Processing…
…it just all seemed to make sense.
The first thing I wanted to do though had nothing to do with Processing: I wanted to get the ‘Scripting Layer For Android‘ (SL4A) installed on it so I could run Python (which I love more than Processing), in a shell, on my phone. I documented how to do this on the Android Emulator in a previous post (and waxed lyrical on how I’d like to program on an Android phone in a post before that). However, to get all this working on a real phone, I had to jump through some hoops.
Disclaimer: I’m a total smartphone\Android noob, and this is the first time I’ve ever written words like ‘sideload’ or ‘root’. I did this a day after getting the phone, never having owned a smartphone before. So for most of it I was just fumbling in the dark. There may be easier ways, but I had a terrible time finding any kind of documentation on anything. Any documentation I did use is linked to below.
A. Time To Root:
AT&T in its infinite wisdom has disallowed ‘sideloading’ of apps onto the phone: You can’t copy something onto the internal SD card and ‘install’. If you try, you get a nice “You can only install apps from the Marketplace” window pop up. Meaning, I can’t install SL4A (or if you can, I just went through a lot more steps than needed…). Talking with my buddies who’s smartphone kung-fu is much more powerful than my own, they told me to look into ‘rooting’ the phone: Give me ‘root access’ on the phone I just bought (shouldn’t everyone have that? I must have missed the politics class on that one). This will allow me to be able to ‘sideload’ apps.
After a lot of websearching, I came across this form post, which describes how to install the “Unleash the Beast” root tool. It seemed to do everything I needed it to in one step: Clean off all the bloatware that came with the phone, disable the annoying on\off sound fx, plus a bunch of other stuff. Most importantly though it gives you root access and enable sideloading. I followed the directions on the site, and it worked flawlessly. Not to say it didn’t stress me out during the process
Excellent, root complete!
B. What happened to my USB?
Loooong story short: When I first got the phone and before the root, my XP laptop wouldn’t detect it. Went online to the Samsung web site to get drivers: Site claimed it had drivers, but when I went to the download page: “This product has no downloads”. I contacted customer support explaining the issue, and their reply was to do the exact thing I had just done. Robot. More websearching: Based on this post, I got a link to the drivers, and installed: the machine could now see my phone. Win.
After the root, when I connected phone to computer, the computer again failed to detect it. Tried plugging it into a different machine: Same result. The phone came with no directions, and the web page for downloads claiming it had the manual didn’t work (like mentioned above). More websearching:
- Settings -> Applications -> USB Settings -> Set to “Ask on connection” (was ‘Kies’).
Now when I plug the phone into the computer, the phone asks me ‘how it should be connected’: Set to “Mass storage” (not Kies). Then access the notifications menu (that one that scrolls down from the top), click on the “USB connected” item, and then “Mount”. Suddenly the computer detects it. What a pain…
C. Get Astro File Manager
Part of executing “Unleash The Beast” was the removal of the built-in “My Files” app. To install the new tools I’d be getting I needed a new file manager: Recommended in several places was “Astro File Manager“. Successfully installed from the marketplace.
D. Install SL4A with Python:
From the Android Scripting download page, I downloaded both sl4a_r2.apk and python_for_android_r1.apk. After connecting the phone to computer and jumping through all the USB hoops, I copied them both to the \Android dir (I have no idea if that’s the right place). Unmounting the the usb drive from the phone’s menu, I then accessed Astro: Browsed to the /sdcard/Android dir, selected ‘sl4a_r2’ -> Open App Manager -> Install. I then repeated this process on ‘python_for_android_r1’. While python was installing, it also downloaded and installed all the other Python .zip files found in the SL4A download page as well.
When it was complete, I had the nice ‘SL4A’ app ready for usage
Note: In hind-site I found the official doc for “Installing Interpreters” which saves you from having to install the Python shell by hand. Main problem is the menu for his app on the phone isn’t that intuitive, and I totally missed how to do it the first time around.
Update: A buddy of mine did this, his install was even easier: On his phone he simply browsed to the SL4A page, and clicked on the bar-code: It installed automatically. Magic.
E. Do something with it:
Launch it -> Settings Menu -> View -> Interpreters -> Python 2.6.2 -> the shell opens:
>>> import this
Continue to Part 2