DTMF dialer got new features
I got a comment from a reader who used my DTMF dialer but missed a feature.
It was the ability to change what prefix to remove. As i live in Denmark, whenever i make a call on a land-line there is no reason to dial +45, which is the danish country code. Actually the plus is converted into 00 as well.
But Eli needed the prefix 08 to be removed.
And i guess that there are a lot of other prefixes that could be removed and + shouldn’t always be converted to 00. So I decided to implement this feature.
Whats new
- It now remembers your settings
- It possible to choose a prefix to remove
- its possible to decide what + should be replaced by.
- I slapped a GPL V3 license on it
The files
Unfortunately it wasn’t just a 5 min hack. There were two major challenges.
Persistence
In J2me access to the filesystem is restricted and requires all sorts of security permissions, but every application has access to a “RecordStore”. The RecordStore (RMS) only allows byte[] to be stored, so you have to marshall/unmarshall every piece of data at quite a low level. I haven’t persisted any data in the first version, as this is indeed tedious to work with. But not having persistence for a prefix remover functionality wouldn’t be of any use. You would have to enter the same data every time you used the application and then it would be faster to just edit the number to call.
Netbeans mobility pack
It was supposed to be so eays.
But the floweditor somehow did mess up and didn’t generate the code, so the flow diagram and the sourcecode were out of sync, and i didn’t see any way to “resync”/”regenerate code/diagram”. This was cause for a lot of frustrations.
Originally i made it with netbeans so compiling and editing the generated code were best done in netbeans. But if i ever were to mess with it again i would seriosly consider “porting” it to J2me Polish or just “vanillia” j2me. As i really really don’t like the netbeans editor.
update : Eli found a bug in the prefix substitution, i fixed and uploaded the new version (June 27, 2009, 21:17)