Saturday, October 29, 2011

I Have Altered the Code...


Monday, June 13, 2011

Perma-droid

I've taken the last step with my HTC HD2 phone and flashed it to Android, a version named HyperDroidGBX.  I did some research on xda-developers.com for a few hours to make sure I had all the information I could capture (there are many write-ups on how to flash the HD2 over, and sometimes they conflict a bit, but I was able to pull a rationalized set of steps out fairly easily).  And then I flashed, and it only took an hour or so to get it all completed.  Very easy once all the information from the helpful posters on xda are compiled in one place.

To do the research*, I started with my specific device in the forum made for it, compared the offerings for NAND ROMs, researched the flashing a ROM sections and FAQs, ...and now I have a supremely quick and powerful phone with a truly huge amount of applications I can run on it.  It feels new again after 1.5 years after purchase (a rare thing).

Will I miss Windows Mobile 6.1?  
No.  It was a dated, and barely functinoal OS.

Will I run Windows Phone 7 sometime in the future? 
No.  Its own OS seems to conflict with the Windows 8 direction towards HTML5 tools, it will likely get a rework or be discontinued in favor of a newer mobile OS (such as Windows 8 for ARM...)


*standard disclaimers apply: I'm not giving out exact instructions on how to flash your phone's ROM, you should read all the material and be aware of the risks and benefits.

Thursday, April 7, 2011

This Was The Droid I Was Looking For...

I purchased an HTC HD2 ([Leo] TMobile US version) when it first came out last spring.  A Snapdragon gigahertz processor, HTC's UI, a 4.3 inch screen, ...and all the kings horses and all the king's men couldn't keep WindowsMobile 6.x from ruining that phone for me.  WinMo was an ok OS 10 years ago, but hasn't done much for non-corporate-sphere users for quite a while.

And I thought I'd be fine with that until Windows Phone 7 came out and could be flashed onto the phone...that is, until Microsoft announced that the HD2 "didn't have the correct hardware button configuration", or some such.  Even with that news hitting after I purchased the phone,  I knew that bootleg versions would probably be available pretty quick after wp7's release so didn't panic.  And the place to get them would be on this fantastic site xda-developers.com which used to be pretty much a WinMo site, and has grown to embrace most of the phones out (though they favor Android and wp7 now).

So just before SXSW I began the install of a bootloader and an Android OS on the SD card of the phone (no flashing of ROMs, nothing permanent so I could turn back if I needed to).  It was a bit of a risk as I'd need my phone for email, txt'ing, web access, and even calls while at the conference...but I was willing to take the chance.  This Android stuff was looking better and better to me.  The install went fairly smooth (I didn't read the fine print and missed the part about the long initial startup due it being from the SD card, after which its fairly snappy every time).  Since I did that I haven't run WinMo once, and I won't be looking back.  The community and wealth of applications, both good and bad, are astounding and worth it alone to switch.  Take into account the OS is modern, solid, and so well suited to running on a device, and the decision to switch is overwhelmingly pointed towards Android.  If you have an HD2 (or a whole slew of other phones), I'd recommend checking the xda-developers site out, specifically this post to get started.

My phone before...
...and now much improved.

Tuesday, April 5, 2011

Converting From WMA to MP3

I have a fairly decent sized library of music ripped from CD or flat out bought digital.  The main problem is, as I move towards Android on the phone and because I use my phone as a portable media player, a lot of non-MS software just don't like the ol' WMA.  So, I set out to find a solution.

I found a fine tool ffmpeg.exe and a great script to drive it with PowerShell lifted from this site (my thanks go to Paul for creating the script).  However, I of course have one wrinkle in my folder configuration that causes the script to error and not function:  I have a space within the path to my music folder (probably most of us do).  So I began to read about escaping and dereferencing of PowerShell code within a script.  It turns out its not all that easy, but it is a bit of a touchy issue no matter what you're coding in (e.g. at searching a SQL text field and a name like O'Reilly comes up and screws your SQL because an apostrophe is the end of enclosed text).  After a lot of reading it turns out that putting a single ampersand at the beginning of the text fed to the Invoke-Expression call is all it took.  So here is my version of the script:

(The script assumes a default install location for ffmpeg, and needs a change to the path of Get-ChildItem in the For loop per specific machine config.)
# wma2mp3 conversion powershell script... since my >€600 car stereo does not understand wma....
# dec 2010 version 1.1 Servercare, Paul Weterings

$tool = '"C:\Program Files (x86)\WinFF\ffmpeg.exe"'
$succescounter = $failurecounter = 0

# we simply find all the file objects that and with .wma, and iterate through the folders recursively
# note that we are converting everything in the M: drive here, another example might be:
# (Get-ChildItem "f:\music\" -include *.wma -recurse)

foreach ($child in $(Get-ChildItem "C:\Users\UserName\Music\" -include *.wma -recurse))
{
    $wmaname = $child.fullname
    
    # Since we convert the file, lets give it the appropiate extension, note that the function is case-sensitive
    # so we handle that first
    $wmaname = $wmaname.Replace("WMA","wma")
    $mp3name = $wmaname.Replace("wma","mp3")

    # The argument string that tells ffmpeg what to do...
    $arguments = '-i "' + $wmaname + '" -y -acodec libmp3lame -ab 160k -ac 2 -ar 44100 "' + $mp3name + '"'
    echo "-----------------------------------------------------------------------------------------------------"
    echo "----- Processing: $mp3name"
    #echo "$tool $arguments"
    Invoke-Expression "& $tool $arguments"

    # Lets see what we just converted, did everything go OK?
    $mp3file = get-item $mp3name

    # if conversion went well the mp3 file is larger than 0 bytes, so remove the wma file,
    # otherwise leave the wma file & remove the (zero length) mp3 file
    if ($mp3file.Length -gt 0)
    {
        echo "----- removing $wmaname"
        Remove-Item $wmaname
        $succescounter++
    }
    else
    {
        echo "----- removing $mp3name"
        Remove-Item $mp3name        
        $failurecounter++
    }
}

# We are done, so lets inform the user what the succesrate was.
Echo "Processing completed, $succescounter conversions were succesfull and $failurecounter were not."

The magic line that makes it work with a space in the path is:
Invoke-Expression "& $tool $arguments"

This ran on a fairly beefy desktop for over 14 hours to convert about 5.5k files occupying 34GB.  But chug away it did.  There were some WMA's that couldn't be deleted but wasn't an issue to clean up.

Also, thanks to Darshan for his easy-to-follow post on how to install and use SyntaxHighlighter 3.