Tuesday, February 1, 2011

Installing standalone applications (like Quickoffice) on a restricted Android device

The Android 1.5 (and now 2.1!) image on my Motorola Backflip came bundled with a "view only" crippled version of Quickoffice. This was OK until a few weeks ago, when I was away from my laptop and needed to edit a spreadsheet. I searched for a Quickoffice update in the Android Market. No dice. I visited the Quickoffice website, read the install instructions for Android, and quickly found that my phone doesn't have an option to enable web-downloadable app installation outside of Android Market.

A few moments later, a light bulb turns on. I've been doing some tinkering with Android app development. The Android SDK provides a way to install my apps on my device. It should also allow 3rd party apps to be installed, right? A quick purchase of the full version of Quickoffice (downloading to my PC), a few keystrokes on the command line, and I'm editing Excel documents on my phone. Cool. It's pretty easy, even if you don't carry the nerd gene and/or have any intention of using the SDK for app development.

Here's what you need to do:
  1. If you don't have Java JDK version 1.6, download it from Oracle. There is a JRE and JDK, make sure you get the JDK. Install the JDK. If you don't have the JDK installed, the Android SDK installer for Windows will complain.
  2. Download the Android SDK from Google. The current version as of this post is r09. There is a version for Linux, Mac, and Windows. If you are on Windows, I recommend using the Windows installer version. Install the Android SDK. I installed to C:\Android\android-sdk-windows
  3. If you are using Windows, download a USB driver for your device. This driver lets you connect to the device in "debug mode". Depending on your device, it may be tricky to find a driver. Google has a pretty good list of links to OEM USB drivers for various manufacturers. Install the USB Driver for your device. You may need to reboot.
  4. Switch your device into debug mode. On my device it is through "Settings" -> "Applications" -> "Development" and then I click the checkbox next to "USB Debugging".
  5. Using a USB cable with data capabilities (some cables are "charge only"), connect your device to your computer. If you can connect your phone as a removable storage device, your cable is a data cable. If you are using Windows you may see new hardware being detected and installed. You may need to reboot, again...
  6. Assuming you are using Windows, open a command prompt (Run... "cmd.exe") and change to the "tools" directory of the Android SDK. (cd C:\Android\android-sdk-windows\tools).
  7. Run "adb devices" to see a list of devices. You should see your device listed, although the name may be cryptic. For example, my Backflip shows up as device ID ~TA538XXXQ.
  8. Download whatever Android app you'd like to install and save it to a directory on your PC. For example, I downloaded Quickoffice and saved it as C:\Android\qoandroid_3_3_102_QO.apk.
  9. Run "adb install C:\Android\qoandroid_3_3_102_QO.apk" to install the application.

That's all there is to it. If your version of Android contains a canned version of Quickoffice, like Android on the Backflip, you'll be stuck with two versions. I just ended up creating a link to the new version on the "desktop" of my phone.

Tuesday, October 19, 2010

Diskless Netflix on PS3

I can finally stop my ranting about Netflix requiring a disk on the PS3. I just got an email from Netflix saying that the player is now downloadable from the Playstation Store. According to the email -

To watch instantly via your PS3 without the disc:

1) Go to the PlayStation® Network section of the main menu.
2) Simply install Netflix from the "What's New" area.

That's it. There's no need to send the disc back to Netflix.


This is especially good news since my streaming disk just got the scratch of death and I was all set to request a new one.

Monday, August 23, 2010

Good-bye Launchcast, hello Pandora

I admit it. I'm normally light years behind when it comes to the latest and coolest stuff on the web. I learn about most of the new stuff from my teenager who spends most of his free time surfing the web or tinkering with apps on his iPod touch. Last week, my old and not-so-reliable DVD player decided to flake out. OK, time to upgrade. After a little research I find a Panasonic BD player with Netflix built-in to the firmware for a shade over $100. Perfect.

<rant> The fact that I have to use a disc on my PS3 and Wii to play Netflix really irks me. I have a 300GB harddisk in my PS3 and I have to pop in a disc every time I want to watch a movie. Why can't I download the software from the PS3 store and install it locally? It is not that I'm too lazy to get out of the recliner. It is the fact that I shouldn't have to.</rant>

Anyway, I get this new BD player, hook it into my network, get the firmware updated, and start browsing through the network based apps. It looks strikingly like Wii channels. Weather forecasts, Netflix, YouTube, ... and Pandora. I get Netflix enabled in a minute or two and have access to my instant queue. Cool. OK. I've heard this Pandora thing mentioned before, but what is it? I open it up and within a few minutes I'm listening to a mix of my favorite music though my audio system. Very cool. I've been a Yahoo Music/Launchcast user for years, but no more. Pandora is faster, the commercials are less irritating, I can mix my music and best of all it works on most of my other music devices - Android phone, PS3 browser, and my laptop. I haven't tried our Wii yet, but I'm guessing it'll work on the Wii browser too.

Thursday, August 19, 2010

Debugging JConsole plugins from Eclipse

I've recently been working on a plugin for JConsole - the Java Management Console that is bundled with Sun JDK 1.5 and 1.6 and IBM Java SDK 1.6. Logging was an OK debugging technique to start with, but as my code grew more and more complex it became more cumbersome to pick through logs. I did a bit of searching and found several forums with folks asking how to do code level debug in Eclipse, but no solution. After I bit of head scratching and experimentation, I found a nifty solution that works great in an Eclipse environment. I am currently building my JConsole plugin project in Eclipse (as a Java project) and have a JAR file specification to generate a plugin jar.

In order to enable (remote) debugging of JConsole execute JConsole with these options:

jconsole -pluginpath /myPlugin.jar -J-Xdebug -J-X noagent -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

The kicker is specifying each JVM option as a separate -J options. I have an Eclipse external tool configured to start the console with these options, but you can run from the command line as well. The suspend=y option tells the JVM to suspend JConsole startup until a remote debugger connects. After executing the command you'll see something like:

Listening for transport dt_socket at address: 8000

The JConsole window won't actually display until you've connected with the Eclipse remote debugger. To do that, highlight your plugin project and select Run -> Debug Configurations... from the Eclipse menu. Select "Remote Java Application" in the left pane, right click and choose "New". Make sure your project is specified in the connect tab and keep the defaults for connection type and connection properties. If port 8000 is in use on your machine you'll need to specify a different port for the jConsole Java args and as the Eclipse remote connection port. Next, click Debug. The JConsole window should pop up and the debugger should halt on any breakpoints you've set in your plugin code. Happy debugging!

Saturday, August 14, 2010

Simplified dual boot configuration for Windows 7 and XP with EasyBCD

I "upgraded" my desktop PC to Windows 7 a few months back. Since Windows 7 won't do a simple OS-level upgrade from XP (what was MS thinking?!?), I decided to drop a fancy new 1TB SATA drive (a major upgrade from the old 200GB PATA drive) in the PC right along side the old timer - with the hope that the old disk could soon retire along side the plethora of old hardware in my attic. First: Install Windows 7. Check. Next: Move data. Check. Next: Install battery of software - MS Office, Acrobat Reader, JDK, Eclipse, ... (4 hours later) Check. Everything looks good. Windows 7 runs very nicely on this old dime-a-dozen 3.0 Ghz P4. I'm very impressed.

A few days later, the old drive becomes a resident of the land of misfit hardware in my attic. Cool. That drive was noisy and slow anyway...

Recently, I tried to use Pinnacle Studio 9 to pull some video off a video recorder (older MiniDV recorder with firewire link). The DV capture did not work on Windows 7 and no patch from Pinnacle (that reminds me... I should see if they've released one yet). I grumble a few four letter words and head up to the attic. A few minutes later, the old bugger is out of retirement and humming away. I use the BIOS level config to boot old the disk, capture some video, and life is good.

Irked by the BIOS flip-flop garp, I start thinking - doesn't Windows have a multi-boot facility? Can't I use that to choose which disk/OS to boot on startup? A quick Google search tells me I need to start messing with bcdedit. It is clunky, poorly documented, and I'm pretty sure I'm going to end up bricking both drives. Digging further into the search results I find EasyBCD. With a couple of clicks, EasyBCD added the option to boot XP to the Windows 7 boot menu and it works flawlessly. I no longer have to hit F2 at the magic moment in order to get into the BIOS config menu to boot the XP disk. As a double bonus, I don't need do it again on a reboot to reset the boot disk back to Windows 7. EasyBCD is freeware, but the publisher will happily accept donations. I think they'll see a few bucks float their way from me.

Monday, July 12, 2010

The Motorola Backflip gets an update

Motorola + AT&T finally posted an update for the Backflip last week. It isn't the Andriod 2.1 the masses (myself included) have been impatiently waiting for, but it is something... The two part update was a snap and took about 15-20 minutes over a good 3G connection. The camera app seems to work much, much better (faster + doesn't black screen 1/2 the time). Also, it seems to correct an intermittent issue I had with the phone rebooting itself when disconnecting it from a usb data+charge connection. Now if they'd just hurry up and get the Android 2.1 update out there!

Monday, June 21, 2010

Apache OpenJPA Bean Validation primer available

A few weeks ago I decided to write up a primer which explains the basics for using Apache OpenJPA 2.0 with Apache Bean Validation (in incubation as of this posting). The combination of JPA with Bean Validation gives you a standardized persistence mechanism (JSR-317), coupled with a standardized and powerful means to do data validation (JSR-303). A simple example is provided with the primer, with the hope to create an interactive and more effective sample in the near future. Enjoy!

-Jeremy