Friday, March 5, 2010

file:// URLs on Android

I have been following issue 2454 for Android's browser for close to a year now and I am very excited to see that it has now been resolved.

One of the things that I loved about the PSP was that it had a decent sized screen and an okay browser (for plain text webpages). As a result I used my PSP for reading ebooks, notes that I had written, and other sorts of text. The iPhone is completely useless for this task from what I have seen, and Android devices made it painful.

I have been trying this out on my Android phone and it works quite well, all you need to do is dump your html files on to the SD card (lets say you put index.html in the root folder) and then point your browser to file:///sdcard/index.html.

Note that if you just have a simple html file the text will appear tiny and unreadable and you will have to zoom in to each page you switch to, which is annoying to say the least. In order to fix this you can add the following tags to each page:

<meta name='viewport' content='initial-scale=1.0, width=device-width, user-scalable=no' />

You can learn more about these viewport settings at the Safari developer center.

No comments:

Post a Comment