Archive for the Development Category

Gymtrakker

Posted in Development, iPhone on June 22, 2008 by David Smith

The process of software development is slow sometimes. Especially when the day job and taking care of the house get in the way.

Having said that, my progress on the Gymtrakker program could be much further along if I hadn’t hit the roadblocks I have.

The last time I wrote about this, I had figured out that the wireless surround speakers had been interfering with my wifi. Soon after I wrote that post, I upgraded my computers to Leopard, which broke my app in several interesting ways.

First of all, Leopard ships with PHP5 instead of PHP4. That took some figuring out.

Then, I realized that not even PHP5 is turned on by default. Easy enough to turn on.

Then I ran into the database problems. PHP5 on Leopard is not compiled with PostgreSQL support, only MySQL.

Which would be fine, since I had written the whole thing to be database-independent* and only had to do a few tweaks to the db interaction layer to fix the entire app, except that I wanted to move my Gymtrakker server to my G5 tower from my MacBook Pro and there was no pre-built binary of MySQL for PowerPC Macs running Leopard. So I built it myself using these instructions.

But it still didn’t work. And no one I know has been able to fix it, so I’m still figuring out what’s going wrong.

(NOTE: I originally drafted this post a few months ago, and still haven’t gotten back to figuring this out. Funny how life gets in the way.)

*I don’t like using the word “agnostic” when it comes to technology, because it’s inaccurate. The true meaning of “agnostic” means “something that we cannot know” from the greek “a” – “without” and “gnostic” – “knowledge”. When used in the religious sense, it truly means “we cannot know whether there is a god or not”. But it has been diluted to mean “I don’t care whether there is a god or not”, and hence in the technological sense, “I don’t care which technology we use.” I disagree with this use of the word, although I agree with the sentiment.

It’s a Hardware Problem

Posted in Development, iPhone on April 9, 2008 by David Smith

Several months ago, I wrote about an iPhone web application I’m writing (current code name: GymTrakker). What with the whole “moving across the country and starting a new job” thing, I haven’t had a lot of time to spend coding it. But I have been using it (well, until recently, see below) and am about to get back into it.

The problem is, of course, that I need to redo everything.

Well, not quite everything. Let me back up a bit.

Literally two hours after we moved into the new house, we had working Internet. Within a few days of the movers showing up, I was back to using the Bowflex. Every time I tried to use GymTrakker, though, I would lose wireless connection to the server (the server being my MacBook Pro in the other room).

I couldn’t figure out what was going on. Anne was reporting periodic network problems from her office downstairs as well, but it was intermittent and I didn’t track it down right away.

Sometime after she left for Belgium, though, after several workout sessions with no wireless connection, I decided to figure out what the problem was.

After some debugging, I figured that it was the wireless that was the problem, not the actual Internet connection (my G5, connected via CAT-5 was working fine). And it seemed to happen mainly when I was working out, or otherwise watching DVDs in the workout room (since it’s the only TV we have right now, I sometimes eat dinner in there while watching a DVD).

My first thought was that the TV has wireless headphones, and that signal might be interfering with the wifi. But after checking the manual, it didn’t seem to be in the same frequency band.

Then I remembered that the DVD player/home theater system has wireless surround speakers. A quick look in that manual revealed that it operates in the same 2.4GHz spectrum as 802.11. Bingo.

Ever since I disabled the wireless surround speakers, the wifi has been working flawlessly.

Once I solved that issue, I figured I could start using GymTrakker again. Oh, how wrong I was.

You see, in the meantime, I had upgraded my Macs to Leopard (Mac OS X 10.5). After a night of Googling, I discovered the following things about Leopard:

  • The PHP that is included is now PHP5
  • PHP is not turned on by default
  • PHP 5 on Leopard is not built with PostgreSQL support

I discovered these things in sequence of course. First, I realized that the new PHP has a different location in the file system. Then I found out how to turn it on. Finally I realized that it wouldn’t work with Postgres.

I think the only way to get Postgres support would be to recompile PHP, which I’m not really in the mood to do, so my next task is to port GymTrakker to work with MySQL, which is supported in PHP5 on Leopard.

Fortunately, I was smart: I abstracted out the database access for just such an occasion. I should be able to switch to MySQL and only change one file that has all of the sql commands in it.

Of course, I only have MySQL running on the G5, and my development environment is still on the laptop, so I’ll need to figure out how to access the database across the network. Shouldn’t be too hard. Right?

I’d Buy That For A Dollar

Posted in Development, iPhone on March 18, 2008 by David Smith

Now that the iPhone SDK is available, I’m sure dozens of people are scrambling to write apps that will make them a fortune, five dollars at a time.

Well, the only idea I’ve had so far – that’s not exactly true, call it the one I want most – is a pdf reader. Really simple, at least for someone familiar with Cocoa and manipulating pdf files. Here’s what I want it to do:

  • Provide storage for pdf files on the iPhone, and a way to easily sync them from iTunes, which already knows how to store them
  • Provide a reader interface which allows for some choice of font size, at least, and some easy way to page through it (I’m not sure how well the finger flicks would work – they’re fine for web pages, but if you’re going to read long documents, maybe another control is warranted)
  • Manual-bookmarking – some ability to bookmark a page or spot on a page to come back to later.
  • Auto-bookmarking. This would work like podcasts – if I quit the pdf reader, or get a phone call or whatever, it should remember where I was in that file, and go there automatically next time I load it
  • Optional: Maintain any pdf “playlists” I set up in iTunes, so I can categorized my pdf files (e.g. Fiction, Non-Fiction, Smut, etc.)

That’s basically it. I see this as a big win for the iPhone, though, for the following reason: It extends its “boredom killing” abilities.

That, I think has been the killer app of all mobile devices, from phones to PDAs to media players. Try to remember what you did BME* when you were in line for something, or filling up the gas tank, or on an airplane or whatever. You might have had to <gasp!> talk to someone, or interact with the world around you. But now, you just whip your your device-du-jour and play a game, or surf the internet, or play music, or listen to a podcast. Boredom has been banished, mostly.

This would make it even better – you could read eBooks on the airplane, or any other place where signal was insufficient, or you wanted to save battery life.

Right now, I have a series of eBooks sitting on my computer that I got from tor.com, and I don’t know if or when I’ll get to read them, because I don’t want to print them out, and I don’t feel like reading them on the computer. But if I had them in my pocket at all times, I’d definitely get through them.

The main difference between this app and reading pdfs in Mobile Mail are that you can do it in Airplane Mode, and you can have bookmarks – both are crucial.

(Just doing a quick Google search for “iPhone pdf reader” uncovers, among a bunch of apps that require jailbreaking and some websites you can upload your pdfs to, this hack, which I may just start using for now. But I’d still rather have the full-fledged app.)

If no one else writes this app, I might just do it myself, but the only way to get it onto the phone is to pay the $99 to be an official developer. Who knows, do you think enough other people would pay $5 for this type of app that I could make my $99 back?

What iPhone apps would you like to see?

*BME: Before the Mobile Era