Friday, August 22, 2008

iPhone Offline Browsing Step 4: httrack

As I said in my previous post, just install HTTRACK from Synaptic. Then execute:
httrack URL-of-the-site-to-mirror -O /mnt/iphone/ -%v

Once httrack finished, you could open: http://localhost from your mobile Safari to browse those pages. Don't forget to bookmark it!

iPhone Offline Browsing Step 3: sshfs

I want the /var/mobile/Site directory on iPhone to appear like a local drive on the host where I will execute HTTRACK. SSHFS is perfect for this, except there is no Windows port and my Linux box has died. So I installed andLinux Then it won't be easier to install SSHFS and HTTRACK. Simply use Synaptic. And look for these packages. Synaptic will take care of the dependencies for you.

Once SSHFS is installed, create a mount point (an empty directory) which you will use to refer to your remote directory (the one on iPhone) e.g. /mnt/iphone

Then execute:
sshfs root@:/var/mobile/Sites /mnt/iphone

BTW, to "disconnect" (more precisely, unmount), simply:
fusermount -u /mnt/iphone

iPhone Offline Browsing Step 2: lighttpd

Since Safari only works with websites but not local files, the way to get around this is obviously running a website on your iPhone using local HTML files (more precisely, running a HTTP server that serves those files) I installed lighttpd from Cydia for this purpose. Unlike OpenSSH:
1) it's not a featured app so you have to search for it
2) it requires a minimal amount of config (to understand the config, check its wiki. Otherwise you could always cut-and-paste)
3) it requires creating some directories if your iPhone is "virgin"
4) it requires a setup step (add a plist file) to make it start everytime you boot up the phone.

The directories I created are:
- /var/mobile/Sites: directory that stores your local HTML files
- /var/log/lighttpd: directory for log files
- /usr/etc: directory for config files

Basically I followed the steps by this poster except I cut-and-pasted the /usr/etc/lighttpd.conf from this poster in the same thread.

iPhone Offline Browsing Step 1: OpenSSH

One of the most useful "gateway" that opens up access to your phone is the widely used SSH (secure shell)

Once you have OpenSSH installed on your phone, you could connect to your phone from another host using SSH.

I easily found OpenSSH under the Featured App section in Cydia (an iPhone app that helps you to install other Apps. You can think of it as the "unofficial" App Store.)

Once it's installed, it runs in the background automatically. There is no icon for OpenSSH and no need to config it.

iPhone Offline Browsing Step 0: Jailbreak

Having heard all these horror stories of rendering the iPhone unusable after Jailbreak, I still couldn't resist the temptation to make my iPhone at least as good as my old WinMo. And the very first step is jailbreaking. Currently the fastest (and easiet to me) way is using QuickPwn. You could also try the download link here.

Some info that you might find helpful:
1) QuickPwn is supposed to work with 2.0, 2.0.1 or 2.0.2 firmware. Mine is 2.0.1 so I have no experience with the other ones.

2) QuickPwn needs your ipsw from Apple. I found it under "C:\Documents and Settings\\Application Data\Apple Computer\iTunes\iPhone Software Updates" I recommend you to make a copy of it just in case.

3) The real "action" happens inside the command-line window launched by the GUI. Just follow its instructions which involve turning your phone off and then back on (with a special sequence/combo of key pressing) It might sound weird but don't be scared.

Disclaimer: I am not encouraging anyone to jailbreak their phone and you have to understand that QuickPwn is beta software. I am not responsible for any potential damage done to your phone.

iPhone Offline Browsing

This is a 5 part series that describe all the steps it takes to archive a Web site to your iPhone and allows you to browse it offline (by now you all know that your iPhone doesn't always have an internet connection)

Step 0: Jailbreak your iPhone
Step 1: Install OpenSSH
Step 2: Install lighttpd
Step 3: sshfs to mount your iPhone to a PC
Step 4: HTTRACK to archive a your favourite website thru the sshfs mount

BTW, after all these is done, my iPhone could finally match my good old WinMo PDA in terms of offline browsing functionality.

Thursday, August 21, 2008

If your iPhone App refuses to launch......

You iPhone users might have run into this before: after you press the icon of an app, it opens a blank screen and then quickly close itself and go back to the home screen. Worse yet, it happens to all other apps too! You could try what works for me: uninstall the app and re-download it from the AppStore. Not only the downloaded app but also the existing apps will start working again.

This is so tricky that it doesn't sound like a plausible solution but apparently other users have figured this out too so it's probably legit.

Monday, August 18, 2008

Olympics and Globalization

Three Americans, Chris Kaman, J.R. Holden and Becky Hammon, are playing on basketball teams other than USA (Kaman plays for Germany while Holden and Hammon play for Russia)

And by now we are used to the many gymnasts, table tennis and badminton players who were trained in China and play for other countries.

Finally, the arguably biggest name in Chinese volleyball, Jenny Lang Ping, is coaching the American team.

For those who still don't believe in globalization, it's time to turn off the TV (and radio, internet...)

Wednesday, August 13, 2008

Where to find the geotags?

We all know iPhone 3G is capable of geotagging photos taken by the camera. The coordinates are stored in the EXIF data section of the JPG. So, what tool allows you to view the EXIF? JHead is one of such tool on Windows (command line, i.e, runs under DOS prompt) BTW, I googled to find out if GIMP allows you to view EXIF and couldn't find a definitive answer. If you know, please leave a comment here.

Wednesday, August 06, 2008

Apple helps fighting recession?

...... or making inflation worse? I'm no economist. All I know is Apple has altered its "universal connector" (found on iPod and iPhone) in iPhone 3G and made all sorts of accessories incompatible (glad that Apple chose the word "universal" instead of "Plays for sure" :P)

I found that out by plugging my old iPod FM transmitter/charger into my iPhone and it warns that it won't charge. So I googled and confirmed that charging thru the "Firewire" pin is no longer supported (only the "USB" pin works) and you will be surprised to see how many accessories out there uses the Firewire pin (perhaps a relic from the 1st gen iPod. Anyone remember it? It WAS the reason people putting Firewire on their PC!)

Fortunately my old charger was a gift but I feel bad for those who spent $200+ moding their car for iPhone and found that their 3G won't charge (Ridax "saved" the day for them, sort of)

Apple is indeed the best friend of the iAccessory industry. Not so much for the iUsers. And I'm surprised so few people are complaining. I see a lot of posters in various forums simply accept this fact, move on and buy brand new accessories all over again. That should be good for the economy, right?

Tuesday, August 05, 2008

Firmware 2.0.1 is out

I have not tried yet but I saw someone who has not tried and posted about it and got highly ranked by Google so I think I might as well do the same.

I did a quick search and found that it is supposed to reduce lags (especially for Contacts) so it might worth a try. Use at your own risk though!

The microphone is a button!

For my first few days of using the iPhone, I wish there are buttons for (1) accepting phone calls when I'm using the included wired hands-free headphone and (2) pausing music.

It's obvious that I could use the "Software" buttons (i.e., the one on the touch screen) What is not so obvious is that the microphone on the hands-free is THE button for both (1) and (2). (Thanks to this post by Matt Ryall)

Monday, August 04, 2008

Custom ringtone on iPhone

For some reason I always put this on my top priority list for my phone even though I hardly get any phone calls at all! I could use any song from the library on my old phone (SE W800i) However, it's not as simple on the iPhone:
1) convert your song to AAC
2) cut it to under 30 seconds (could do this before Step#1)
3) change the extension of the file to .m4r
4) add the file to iTunes and it should appear in the Ringtone section.

If you think these steps are too complicated, good news for you: the freeware iRinger does all these for you.

Finally, you need to sync the ringtone to your phone. You can't just drag-and-drop from the item you see in Step#4 to your phone in iTunes. Instead, click on the name of your phone on the left pane. You will see the main page for your phone on the right pane. Click the "Ringtone" tab and check the "Sync" radio button (make sure the ringtone you want is selected) Then "Apply" this change.

Now you could choose these ringtones under custom on your iPhone!

How to tell when iPhone 3G is fully charged?

The iPhone is fully changed when the icon in the top bar changes from a lightning bolt to a two prong power symbol. (Thanks to the reply to this post by aristotles. Like the other posters, I also wonder why it has to be so subtle.)

Friday, August 01, 2008

Outlook and iPhone

One of my bigger concern before buying the iPhone is that my address book has been carefully maintained in Outlook (Yeah, I know I should have gone Open Source but I need it in order to sync to my WinMo PDA) And from the Google result I have mistaken that I need MobileMe to sync Outlook with iPhone. That's a misunderstanding: iTunes took care of it out-of-the-box. It found my Outlook and asked me what I want to sync (Address book, Calendar...) As simple as that!

This post will not exist if iPhone is really that easy to use

Enough with the negativity in the title :P You could also see this post as tips for "advanced user." Indeed, I didn't need to read any manual and these things are kinda easy to Google for:
1) Bluetooth headset
To pair it with your non-Apple brand headset, go to Settings->General->Bluetooth. Turns it on. Then put your headset into "pairing mode" (for my Motorola headset that has only 1 button, I simply turn it off. Then turn it on. Keep pressing the button down for a while and it will go into this mode) Your headset should appear on iPhone's screen. Depends on whether iPhone is in a good mood, you may or may not need to enter the passcode (usually 0000)

Next, how to tell it's paired? Check the bluetooth icon on the top-right corner. If it's greyed out, something's wrong.

2) Force quit an application
The ability to "kill" an app when it is misbehaving is pretty standard functionality. Apple calls it "force quit" (I suppose it's more humane than kill) To force quit on iPhone, simply press and hold the "Home" button (the one below your screen!) for six seconds.