TSR2

Adventures in Android

Unlike most computer science graduates, I am not a gadget freak. I want my gadgets to be useful. I won't spend a fortune on some cool gadget that lasts 5 minutes and I don't want to be available on my phone 24/7 or permanently online.

Not surprisingly I have a simple camera phone, which is theoretically capable of internet access, but has not had data enabled. My wife decided that it might be worth having a smart phone when we go travelling, so we can Google the local sight s and she can access her email. I agreed to look into it.

First, I needed to be sure that we can get a local SIM with reasonable data charges, as roaming charges of £5/MB would make a smart phone stupidly expensive. Fortunately the local telco does an acceptable PAYG data package in our intended destination.

Next, I need to research phones. I need something unlockable, preferably already unlocked and I don't want an expensive toy. If we like it enough we might upgrade, but we're just dipping our toes in the smart phone waters.
An Android phone seems to be the obvious choice, there are plenty of budget Android phones available and it offers good email access, various apps that my wife would like, e.g. Facebook and free(ish) sat nav functions, which could come in handy. A little digging around suggests that the ZTE Crescent, marketed as either the T-Mobile Vivacity or the Orange San Francisco II, is a well regarded budget phone. An unlocked new, or nearly new, T-Mobile Vivacity seems to fetch £80-£100 on ebay and occasionally you can pick one up for even less.

I miss one or two that sell at the right price, when I'm not ready to bid and I bid on a few that go over my target price. I see a locked vivacity with a day to go at £60 with no bids. I'm not going to be around when the auction completes and I assume it's going to go for more than that, but I put in the starting bid. Surprisingly nobody else bids and I've bought the phone. As this one is locked, I'm going to have to unlock it myself.

First I want to familiarise myself with the phone. Not surprisingly an O2 SIM doesn't work because the phone is locked to the T-Mobile network. I was slightly surprised that a Virgin Mobile SIM worked. I was expecting it to be locked to the operator as well as the network, but apparently it will work for MVNOs on the T-Mobile network.

Searching for authoritative information on unlocking a ZTE Crescent comes up with a 200 post thread on modaco.com that is often linked to as the definitive guide, but it's daunting, particularly as many of the posts are from people who seem to have "bricked" their phones. Later I come across this guide, which is much less daunting.

When I go for it, the process isn't too bad. It seems to wipe the ROM, but I have downloaded a stock T-Mobile ROM to the SD card, as advised and installing this is straightforward. It then accepts the O2 SIM with no difficulty. As the O2 SIM is not data enabled, I can't test the 3G functionality. I also find that the MAC address has been wiped, so wifi doesn't work either and I have no network access at all. Apparently this is a common problem, the instructions had advised making a note of the MAC address and the procedure to restore the MAC address was documented.

When I subsequently acquired a data enabled ROM, the phone functions worked just fine but the mobile networking did not. A little research revealed that each network has it's own APN (Access point Name) settings, which need to be configured to access mobile networking. Once I set up the right APN I had no trouble accessing the mobile network.

Having got this far, it does what I need for now. I am tempted to go further. There are debranded ROMs available, but if I debranded the phone I would go the whole hog and install CyanogenMod 9 to get Android 4 (Ice Cream Sandwich) on the phone. No doubt I will do that eventually, but that's and adventure for another time.
TSR2

Iterative debugging

This iterative debugging thing isn't going so well.

I've been spraying the same chilli plant all winter and I thought I'd finally cleared out all the greenfly a couple of weeks ago. Today I notice 3 tiny aphids on one leaf and a closer look found a major outbreak elsewhere.

Here endeth the lesson. Let us spray.
TSR2

Recovering a corrupt LibreOffice Spreadsheet

I had an interesting problem last week. I was handed a corrupt LibreOffice spreadsheet and asked if I could recover 4 hours of work. After determining that the auto-saved backup was also corrupt, I decided to take a look at the contents.

Fortunately the OpenDocument format is a zipped bundle of XML files, so it's reasonably easy to look into. The error message from LibreOffice wasn't that informative, but it gave me a file name (content.xml) and location.

I extracted content.xml and opened it up with a text editor (emacs, if anyone cares). I thought it would probably be truncated, but it looked as if it was a complete document. Opening content.xml in Firefox gave me a more meaningful error. It told me that the problem was a duplicated attribute.

Navigating to the specified location showed me a chunk of XML that looked like

<table:table-cell table:end-cell-address="'Other Information'.B29" table:end-x="1.212cm" table:end-y="0.356cm" draw:z-index="3" table:end-cell-address="'Other Information'.B29" table:end-x="0.874cm" table:end-y="0.205cm" draw:z-index="4" table:end-cell-address="'Other Information'.B29" table:end-x="1.212cm" table:end-y="0.356cm" draw:z-index="5" table:end-cell-address="'Other Information'.B29" table:end-x="1.212cm" table:end-y="0.356cm" draw:z-index="6" ...

My best guess was that this should be multiple <table:table-cell> elements, but for some reason they had all been written out as a single element, but with the attributes of the 8 elements that should have been there.

Trying to edit this in emacs was painfully slow, as I was short of memory, this was a 28MB file and, judging by the CPU usage, every change was reparsing all or most of that XML, so I switched to fundamental mode and that made editing a lot quicker.

I split that element into it into multiple elements like this

<table:table-cell table:end-cell-address="'Other Information'.B29" table:end-x="1.212cm" table:end-y="0.356cm" draw:z-index="3"/><table:table-cell table:end-cell-address="'Other Information'.B29" table:end-x="0.874cm" table:end-y="0.205cm" draw:z-index="4"/>...

After that, reloading the 28MB into Firefox almost brought my system to it's knees, but Firefox was happy with the XML. I replaced the original content.xml in the spreadsheet file and opened it in LibreOffice. It looked OK, so I returned it to the user, who could not find any errors or missing data.
  • Current Mood
    okay okay
TSR2

Computer Problems?

I just had my first call from an Indian sounding "gentleman" wishing to discuss the problems I was having with my computer running slowly. Unfortunately I had my hands full at the time and couldn't explore the possibilities for amusement. With hindsight, I should have asked him to call back later :-)
TSR2

I'm Back

I thought I'd lost my LiveJournal account. Turns out that Firefox's form manager had 2 versions of my LiveJournal password, an incorrect version for http://www.livejournal.com and the correct version for https://www.livejournal.com. I was of course, trying and failing to log in with the incorrect version. I couldn't reset it because LiveJournal still had an ancient email address.


It was only when I found there were 2 versions and went to https that I could log in. Time to update my email address, back up the password in KeePassX and generally pretend that the LiveJournal account means something to me.
TSR2

Setting up a JetDirect 600n

I bought a JetDirect 600n on ebay recently because it was cheap (£4.50) and Justine is having various problems using the printer via Samba. It didn't arrive, but the seller sent me another. I was half expecting the first one to turn up with the second, but Murphy seems to be having a day off.

Anyway, configuring it on a printer without a control panel is fun, especially when you make stupid mistakes. I configured it via telnet from my Linux box and I put the address on the wrong subnet. The way to reset it is apparently to do a cold reset, but cold resets on a Laserjet 2100 require firmware v 19991018 or higher and mine has firmware 1990828, so the way I fixed the IP address seems to be to move my router onto the subnet the printer is on. Of course I then have to reset my IP address to access the network before reversing the whole process.

I did try to get the router to route to the subnet it was in, but it didn't work and I wasn't prepared to spend ages troubleshooting a temporary configuration. At that point I didn't think of upgrading the firmware.

Once I've got everything on the right subnet I have to figure out how to get all the different operating systems to talk to it. XP requires me to set it up as a local printer and set up an IP port. That's confusing. On Linux CUPS configuration is mostly easy, but it's not obvious that the URI should be socket://10.20.30.40. Surprisingly Vista was remarkably easy, I asked it to autodiscover network printers and it just worked.