Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, January 07, 2010

No Nokia PC Suite on the Mac? Try Gammu!

With almost every mobile device I've had, the amount of freedom to run arbitrary software (especially software you've written yourself) has been low. Obviously needlessly low, too.
I once bought a USB datacable for my old Sagem X-5 to upload ringtones and Java programs without having to upload them to a webserver and download them with the Sagem over WAP/GPRS. I got ringtones working, but it turned out that it was impossible to upload Java programs over the cable.
Why? Well, there's no apparent technical reason for it - but it works out in the operator's favour, forcing you to download (from yourself) over their very expensive data service - at that time, it cost €0.02 per kilobyte with Meteor, which works out at €20.48 per megabyte, a shocking waste of money!

Similarly, when I bought my Nokia 6230i back in 2006, I soon discovered that while it could download Java applications with no problem, it was impossible to install them via its MMC card. The JAR/JAD would appear in its filesystem browser, but it would declare it an "unrecognised format".
Nokia did, however, release a package called the Nokia PC Suite, which was a reasonably comprehensive tool for doing lots of different things with the phone, including the installing of Java programs. And it worked via data cable and Bluetooth. Great!

Except that now, I don't have a Windows PC (at least, one with Bluetooth or a data cable). And it only runs on Windows (surprise!). My Macbook has built-in Bluetooth and can send files via the built in utilities, but the same "unrecognised format" issue pops up.

So that was the end of my frustrating search, until yesterday... enter Gammu!

This open-source program comes with a host of features for working with different types of phones, including my 6230i, and I was able to upload and install a Java application to the phone with Gammu over Bluetooth, finally!
What's the catch? Well... Gammu itself is a command-line tool so installing a program looks like:

Jehannum:Downloads oisin$ gammu nokiaaddfile Application Bart1.4
[snip debug warnings]
Searching for phone folder: *********
Information: Declared JAR file size is different than real. Fixed by Gammu.
Adding "Bart" version created by Bart
Writing JAD file: 100 percent
Writing JAR file: 100 percent


And Gammu uses a textual configuration file - mine looks something like:

Jehannum:~ oisin$ cat .gammurc
[gammu]

port = 00:16:BC:xx:xx:xx
model = 6230i
connection = bluerfphonet
synchronizetime = no
logfile = /Users/oisin/gammu.log
logformat = textall
use_locking = no


The port value can be found in Apple's "Bluetooth Explorer" in Devices->Show Device Discovery (cmd-D), under your phone's name (but replace the hyphens with colons).

Also you have to build the program from source which requires installing CMake and MySQL, but these have automated installers which caused no brainache. Getting Bluetooth to work required a small fix to one of the build scripts, but this has since been fixed so the latest version should work out-of-box.

So, if you have a Mac and a phone which requires Windows-only software to install applications, try Gammu.


. o O ( Now if I could only find a simple way to upload programs of my choosing to my iPod Touch without having to jailbreak the thing or pay Apple, again :/)

Tuesday, November 11, 2008

the arithmetic calculator exercise in GFA Basic

For a couple of reasons, I tried that arithmetic calculator exercise in GFA Basic (v3.6 for the Atari ST; why not?), and although I selected a somewhat different approach, I think it's really like a non-recursive version of the recursive Lisp version I posted before; with state in variables which persist for the whole loop. This is where side-effects can get mysterious, compared to the neater encapsulation of state in each recursive call's parameters.