Text and pictures © 2009-2024 Guillaume Dargaud
Last updated on 2021/11/05
"To be happy in this world, first you need a cell phone and then you need an airplane. Then you're truly wireless." — Ted Turner (1938-), US businessman.
I thought about writing a longer review of the HTC Hero phone but there are plenty of them already. Let me just say that it is a good phone, very usable, with great software and fewer limitations than the Apple restricted plastic thingie. Before you do anything with it, make sure you update the firmware because you'll lose all your settings.
The good:
Forget about installing the many different avi codecs on your phone, instead you are better off converting your videos to a format it understands: mp4 or 3gp. Ffmpeg to the rescue, here's the basic command to transcode videos for mobile use: ffmpeg -i file.avi -s 480x320 -b 300k -vcodec mpeg4 -ac 2 -ab 128k -acodec libfaac File.3gp
It works but it will probably change the image ratio of the video, so you probably need to lower the '320' value in the above line if the image appears too tall. Keep in mind that on some videos the pixels aren't square, so that confuses things further. If the original video has a proper aspect ratio when watched on a PC, you can issue a ffmpeg -i File.avi to get the frame width and height (the line that says "Stream ... 640x272"). For instance the video has WxH = 640x272 so you correct the ffmpeg factor accordingly, here ffmpeg -i file.avi -s 480x204 -b 300k -vcodec mpeg4 -ac 2 -ab 128k -acodec libfaac File.3gp where the 204 comes from 480/640*272. Round to the nearest integer or multiple of 2. Capici ?
Note that if the original image ratio is less than 4:3, you need to lower 480 instead of 320 using the formula 320/H*W, but that's rare. I've managed to use the an alternate commands with the better quality x264 codecs but it's more complicated and doesn't always work.
Read this if you have trouble setting up ffmpeg with the proper codecs. Note that ffmpeg works on both Linux and Windows.
Here's a script that does the conversion at once, just save it as AviTo3gp.sh, mark it as executable and call it as AviTo3gp.sh File.avi File.3gp.
#! /bin/bash # Script: AviTo3gp.sh # Purpose: Video conversion for smartphones, keeping the ratio # Author: Guillaume Dargaud - www.gdargaud.net # You need (at least ffmpeg and libfaac on your system) # Resolution of the target phone screen DestWidth=480 DestHeight=320 if [ $# -ne 2 ]; then echo 1>&2 "Usage: $0 File.avi Dest.3gp" exit 255 fi # Resolution of the video to convert Width=$( ffmpeg -i "$1" 2>&1 | egrep -i "Stream.*Video" | sed "s/.* \([0-9]*\)x\([0-9]*\) .*/\1/" ) Height=$( ffmpeg -i "$1" 2>&1 | egrep -i "Stream.*Video" | sed "s/.* \([0-9]*\)x\([0-9]*\) .*/\2/" ) if (( $DestHeight * $Width > $DestWidth * $Height )); then DestHeight=$(( $DestWidth*$Height/$Width/2*2 )) else DestWidth=$(( $DestHeight*$Width/$Height/2*2 )) fi echo Converting to ${DestWidth}x$DestHeight ffmpeg -i "$1" -s ${DestWidth}x$DestHeight -b 300k -vcodec mpeg4 -ac 2 -ab 128k -acodec libfaac "$2"
You can use the Hero as a modem for your PC. First of all, it works only if you have a 3G connection active. Then you must have the HTC drivers installed on the PC. Then have the phone connected in either mass storage or Sync mode (for the 1.6 version) or modem mode (for the Android 2.1 version). Then activate the fairly well hidden option found at the bottom of the Wireless settings called "Internet connection sharing".
I couldn't get tethering to work on a Linux PC. Apparently the driver should be able to work with ndiswrapper... More on this in the next chapter.
So I get my connection on Windows, ssh works, ftp works, ping works, email works... But when I try to access the web, all I get are blank pages. Weird, huh ? As it happens, my operator states in their contract that I'm not allowed to use their 'unlimited' 3G connection to connect a PC. Well, fuck that, I pay for it and I'll use it any way I want, right ? Well, not quite: they try to enforce it by detecting if the access comes from the phone or from a PC. The only way they can do this is by checking the user agent field of the browser request. So an easy workaround is to use the User Agent Switcher Firefox add-on. Then you can either try with a blank user agent (usually the preferred way), or you can go to check your user agent with your phone, write it down and set it on your PC. The only downside is that some websites (facebook, Google News...) are optimized for the Phone and display in a simplified way.
A lot faster and easier than you can imagine, it can be done in under a minutes and 4 steps.
You can now go download applications that require root access such as the following essentials: