Zhone is often told to be a demo application for the Freesmartphone.org framework ([[FSO]]). But it actually is a quite usable phone program that allows to send and receive calls, SMS messages and tells you your gps coordinates. The FSO automagically detects when the gps coordinates are no more shown and shuts down the GPS hardware as long as it is not needed.

−

The Framework Testing Image.

+

Since it mainly only sends commands over dbus to the daemons that actually do the work it is rather stable and even able to do multitasking like allowing you to read an SMS whilst using the phone.

+

== Support for letters ä and ö ==

+

+

Apply the following patch to be able to use ä and ö letters in Zhone SMS:s:

+

+

<pre>

+

--- zhone.orig.withvcf 2009-09-28 13:42:27.000000000 +0300

+

+++ zhone 2009-09-28 13:47:47.000000000 +0300

+

@@ -1888,6 +1888,15 @@

+

key = event.string

+

if key == "\x08":

+

self.text = self.text[:-1]

+

+ # Check if the key is aumlaut or oumlaut

+

+ elif event.key == "adiaeresis":

+

+ self.text += u"ä"

+

+ elif event.key == "odiaeresis":

+

+ self.text += u"ö"

+

+ elif event.key == "Adiaeresis":

+

+ self.text += u"Ä"

+

+ elif event.key == "Odiaeresis":

+

+ self.text += u"Ö"

+

elif key is not None:

+

self.text += key

+

self.part_text_set( "label", self.text )

+

</pre>

+

+

==Using VCF within Zhone==

+

Arne sent a small [http://lists.openmoko.org/pipermail/support/2009-January/004394.html patch] that imports phone numbers from a VCF 3.0 address book. Since Zhone has problems with numbers -, the patch below is a sligthly different and removes -.

+

+

In /usr/bin/zhone search for ''class pyphone_contacts(edje_group)''

+

and modify the prepare function:

+

<pre><nowiki>

+

def prepare( self ):

+

if not self.ready and not self.busy:

+

logger.info( "retrieving phonebook from addressbook.vcf..." )

+

file = open(os.environ.get('HOME')+"/addressbook.vcf", "r")

+

entries = []

+

entry_nr = 1

+

name = None

+

number = None

+

for line in file:

+

#if line.startswith("END:VCARD"):

+

if line.startswith("TEL;"):

+

number = unicode(line.partition(":")[2].strip())

+

number = number.replace('-','')

+

number = number.replace(' ','')

+

if name and number:

+

entry = entry_nr, name, number

+

entries.append(entry)

+

entry_nr = entry_nr + 1

+

if line.startswith("END:VCARD"):

+

name = None

+

number = None

+

# Search for both N: and N; since it depends on the VCF file. For example ones created with tsv2vcf.pl have "N:", not the usual "N;"

Beware this patch loads and parses addressbook.vcf on each start of zhone - I was pretty impressed I did not even notice a significant delay on my 241 entries vcf, though.

+

+

If you have multiple phone numbers per contact and these are separated with commas (like an export from abook, e.g. "112233,998877,665544") you don't see the name when being called - and you cannot call these "multiple" numbers. You can extend the above:

+

<pre><nowiki>

+

for line in file:

+

#if line.startswith("END:VCARD"):

+

if line.startswith("TEL;"):

+

number = unicode(line.partition(":")[2].strip())

+

number = number.replace('-','')

+

number = number.replace(' ','')

+

if name and number:

+

- if name and number:

+

- entry = entry_nr, name, number

+

- entries.append(entry)

+

- entry_nr = entry_nr + 1

+

+ nums = number.split(",")

+

+ for num in nums:

+

+ entry = entry_nr, name, num

+

+ entries.append(entry)

+

+ entry_nr = entry_nr + 1

+

</nowiki></pre>

+

This makes up one entry for each number - all with the same name.

+

+

After exporting from abook ("gcrd GnomeCard (VCard) addressbook" format) you should convert it to utf-8, possibly like this (all.vcf is the abook exported file):

+

<pre><nowiki>

+

iconv -f ISO-8859-1 -t utf-8 all.vcf > addressbook.vcf

+

</nowiki></pre>

+

Then transfer addressbook.vcf to your phone. Make sure the name stays the same, it's hardcoded in the code above. On my phone $HOME/addressbook.vcf resolves to /root/addressbook.vcf.

Contents

Zhone is often told to be a demo application for the Freesmartphone.org framework (FSO). But it actually is a quite usable phone program that allows to send and receive calls, SMS messages and tells you your gps coordinates. The FSO automagically detects when the gps coordinates are no more shown and shuts down the GPS hardware as long as it is not needed.

Since it mainly only sends commands over dbus to the daemons that actually do the work it is rather stable and even able to do multitasking like allowing you to read an SMS whilst using the phone.

Beware this patch loads and parses addressbook.vcf on each start of zhone - I was pretty impressed I did not even notice a significant delay on my 241 entries vcf, though.

If you have multiple phone numbers per contact and these are separated with commas (like an export from abook, e.g. "112233,998877,665544") you don't see the name when being called - and you cannot call these "multiple" numbers. You can extend the above: