Very well written explanation. I assume that this is what you think what should happen but not all implemented right now (for example: as far as I could tell, phonebook is the only one that has a convertor func for step 2). If one were to start following this approach (maybe as a test case), what would be the first thing that you think should be added? Also, what's your take on some other ideas such as flagging invalid entries and providing feedbacks to users after each phone get/send operation?
-Joe Pham
Post by d***@netzero.comQuick question: do we have any convention and/or guidlines wrt error
processing of the info being transferred to the phone. A good
example would be what Vic had previously pointed out for Samsung
phones: a phonebook entry name that's too long. What's BP supposed
The phonebook writing happens in several stages:
1: GetFundamentals is called. This interacts with the phone and
get any phone specific information you need. Amongst the useful
things to get is the phone serial number.
2: Your phone profile's convertphonebooktophone method is called.
This method should take the phonebook formatted information
and convert it into whatever is needed for the phone.
3: You phone savephonebook method is called to interact with the
phone and update the content. You should also record any
serial number updates.
4: Back in BitPim, the underlying data is modified with any serial
number updates.
(Note that if you are also writing out calendar, wallpaper, ringtone
etc then steps 2, 3 and 4 will also be done for the data types. They
will all be done at once - eg step 2 for phonebook, step 2 for calendar,
step 2 for ringers, then step 3 for phonebook, step 3 for calendar etc).
Step 1 would be where you consult the phone for dynamic information
(eg if the number of phonebook entries depended on some other factor
and wasn't a constant.) It will also be when various config settings
will be established in the future (eg if you store the names in
First Last or Last First format).
Step 2 is where you would truncate fields, constrain the number of
entries etc. It should do all the data manipulation necessary so that
step 3 won't fail unless there are serious problems. In the future
user interaction will be possible here. I expect that all sorts of
data truncation will happen here, from shortening fields to ignoring
others (eg if the phone only supports one email address but the record
has 4 values). They can all be shown to the user in one go before the
user confirms sending the data to the phone. (We'd probably need some
sorting on severity since I usually won't care that "United Airlines"
has been truncated to "United Airli" for my phone).
Step 3 should be doing a minimum amount of work, basically just dumping
the data already pre-formatted by step 2 into the phone. This should be
as simple as possible, and no user interaction will be allowed (or possible).
Step 4 is when BitPim updates it's own internal data.
I don't think the Samsung or Sanyo phones have serial numbers, so I'll
outline them now. Well designed data sources assign a unique id to
each record. If the record is deleted and another created then it gets
a new unique id. Sync programs can then use the unique id to match records
and changes to them. For example if serial 12 was "John Smith" last week
and now has a name of "John Smythe" and a different phone number now, you
know it is still the same record, and the user has updated their data.
Without a serial you are just guessing.
The LG phones use serial numbers (a 32 bit quantity) so you can do this
syncing easily. Outlook, Evolution, Apple Addressbook etc all use them
as well, except those programs typically use a larger sized value.
BitPim also uses one.
Every phonebook record has a list of serials associated with it, for the
various data sources that the record has come from. If the record also came
from a phone, then there will be one for that including the phone's unique id.
This makes it considerably easier to match the same record when importing
and exporting to various data sources (which includes the phones).
The serial information has a huge effect on the match in the import dialog,
but it isn't treated as absolute truth. It is possible for a data source
to assign numbers again. (The LG phones will do so if you reset them to a
clean state).
The slot numbers on the Audiovox and Sanyo phones, and it seems Samsung phones
could be used as a serial as well. Basically if there is a very high probability
that what was in slot 3 last week and is in slot 3 now is the same record, even
if the information is different then it is useful. It is probably worth
experimenting with.
Here is an example from some of my test data. I have it on Outlook and on my
VX4400 and VX6000 phones:
'serials':
[
{
'serial1': 193,
'serial2': 193,
'sourcetype': 'lgvx4400',
'sourceuniqueid': '1aadcbb3d92021e92b614f326e2de9f3cb1f77d2',
},
{
'id': '73c7bf16536c02928899f3dc8deb13862490a4dd',
'sourcetype': 'bitpim',
},
{
'EntryID': u'000000009FD24B3CF1F64841816E3F7CCCF153D704332000',
'FolderID': '000000009FD24B3CF1F64841816E3F7CCCF153D742810000',
'sourcetype': 'outlook',
},
{
'serial1': 487,
'serial2': 487,
'sourcetype': 'lgvx6000',
'sourceuniqueid': '4af9c590b64261f5fa408a1ea793eec0b5b9a6da',
},
],
If I had more than one VX4400, then there would be another entry for that
one, but with a different sourceuniqueid.
Post by d***@netzero.comOr is it up to individual coders to handle it?
There is a plan, but nothing has been implemented yet. It may be worthwhile
doing a mockup screenshot first with what you would expect to show the user.
I know that as a user I wouldn't care the second time about data truncation
etc :-)
Roger
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!