Information not showing on iPad

Discussions about the smartphone versions
Post Reply
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Information not showing on iPad

Post by Huub »

Hi Sven,

I purchased Diving Log 5.0 last weekend and also got the Dive Log app to go along with it. I'm really happy with the functionality of the PC software.

Due to using different diving computers during the years, and changes in the smarttrack software, my smarttrack data leaves some gaps when I transfered it to the Diving Log and sync'ed it to the iPad. I decided to update the data on the PC in the Diving Log 5.0 database. That worked like a charm. Then I tried sync'ing with the iPad again but it seems that the changed data does not transfer to the iPad. I tried syncíng an empty database to the iPad (which worked fine) and after that send over the actual database. All the dives get transfered, but not all information from the PC goes to the iPad (like tank type, air temperature, tank pressure starting and ending the dive - all data that I changed after initially transfering to the iPad). It looks like some information on the iPad remains even though all dives were deleted on the iPad before transfering from the PC.

I hope I am explaining what is actually my problem correctly and you understand what I'm talking about. Might be that I have to address this issue with the people for the iPad app and not with you. Maybe there is a simple solution to get around my issue. If there is no simple solution, I will be stuck with having to change data for about 650 dives on the iPad, which is something I'm not particularly looking forward to.

Hope you can help me and success with marketing this wonderful piece of software,
Huub
divinglog
Site Admin
Posts: 5779
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Information not showing on iPad

Post by divinglog »

Hi Huub

Thank you very much for your kind words! The whole logbook file at once is transferred to the iPad, so it is normally not possible that just some of the information is visible and some not. So I guess you may just seeing an older version of the logbook file. Have you pressed the green button ("Use new logbook file") on the iPad after the transfer was completed?

Some information is not yet available on the iPad Dive Log (e.g. additional tanks beside the main tank), but the fields you see should update after the sync. Try to change the dive site name of the last dive, for example, and sync the file to the iPad to see if you see the change.

Kind regards,
Sven
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Re: Information not showing on iPad

Post by Huub »

Hi Sven,

I don't seem to have much luck with the transfering my dives to the iPad... Importing my last 26 dives from Smarttrack works fine and all info from the dives transfers perfectly to the iPad... however, older data just doesn't seem to go well. I've tried everything I can think of. Changing the divesite for the last dive and then sync'ing works okay... Changing the divesite for the first dive and sync'ing doesn't. It seems that somehow old data transfers to the iPad. Even changing the information on the iPad, exporting to the PC and importing back does not bring proper results. I'm really at a loss at what is happening.

Just to make sure, I have double checked if I was following the transfer procedure correctly, and that is not the problem.

Like always with ICT systems, it seems to be the interface that is causing troubles :?

If you have any other good ideas I could try, I will. It just looks too silly to have logged the wrong type of tanks with 0 bar remaining, having no repetetive dive after a 2 hr surface interval or having an air temperature of 0 deg C (while diving in Egypt in april).

Thanks for your trouble trying to think along.

Regards,
Huub
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Re: Information not showing on iPad

Post by Huub »

Never mind Sven,

I finally got it working. In the end I just did an incremental export to the iPad: First sync the first 100 dives from PC to iPad and that worked fine. Then the first 200 and so on and so on. Eventually all dives registered correctly on the iPad.

When I first sync'ed the PC log to the iPad, not all information was correct. When I edited the dives on the PC using Diving Log 5.0 and then exported to iPad's Dive Log, just not all information seemed to stick in the iPad and it used information that was still there from a previous import. Anyway, now I'm completely happy 8)

My assessment is that the original problem is to be found somewhere in the handling of larger import files on the Dive Log software and not in your application.

Thanks again for this wonderful program.

Regards,
Huub
gregm
Posts: 63
Joined: Tue Jan 06, 2009 23:04
Location: Bellingham, WA, USA
Contact:

Re: Information not showing on iPad

Post by gregm »

Hi Huub,

Sven just alerted me (I'm the developer of Dive Log on iPad) to the issue that you were having with syncing. Sorry that I didn't see this thread before. I'm glad that things are now working for you. I thought it might be worth sharing some additional information to help avoid any issues in the future. I, like Sven, am confused by what you saw but this background might help in general to avoid any problems with syncing in the future.

When Dive Log on iPad and Diving Log 5.0 on the PC perform a sync operation, all the work is actually done by Diving Log 5.0 on the PC. Dive Log on iPad simply sends it's current database to the PC when a sync is requested in that direction and receives a new database when the sync is performed in the opposite direction. When you press the "Use new Logbook" button on the iPad, the database that you were using is closed, moved to a backup location (and can be received using the "Restore previous Logbook" button) and the new database that was received from Diving Log 5.0 is moved into place and opened as the active logbook. There is no processing that takes place on the database on the iPad, so it is actually technically impossible for the iPad to retain some information from the old database and some from the new database. You get everything that was sent from the PC or nothing.

The sync operation on the PC side is actually quite sophisticated. Both Dive Log on iPad and Diving Log 5.0 on the PC keep track, at a record level, of when records are updated and added (each record in the database has a globally unique identifier and a time stamp). This means that when you make a change to a dive (say change the water temperature), that dive's timestamp is updated. If you subsequently make a change later in the same dive (i.e. one that shares the same globally unique identifier) on either device (say you change the maximum depth of the dive), the timestamp will again be updated.

Now, there are two directions that you can sync. When you sync from the PC to the iPad, the PC simply takes all it's data and sends the whole database to the iPad. In this case, anything on the iPad will be completely replaced with the data from the PC (after you tap the "Use new Logbook" button). If you had made any changes on the iPad, these changes will all be lost (they will be saved in the backup file, but not merged into the incoming file in any way). So the normal thing to do if you made changes on the iPad is to first sync the iPad to the PC and then sync the PC back to the iPad. In this case, Diving Log 5.0 will go through it's sync process to integrate the changes from the iPad with the changes on the PC before transferring the whole (new) logbook file to the iPad (which will then get loaded when you tap the "Use new Logbook" button).

The sync process when you sync from the iPad TO the PC will look at each record in the database and compare the one from the iPad with the one currently on the PC. If the globally unique identifier matches, the Diving Log 5.0 will pick the record with the latest timestamp as the winner and that entire record will be the surviving record. In practice, this means that if you edit the same dive as described above on both platforms between syncs, then only the one changed most recently will be the winner (so if you change the temperature on the iPad and then later changed the depth on the PC then the entire record on the PC would be the winner and the new depth would be saved but the new temperature would not since the sync is at the record level). The practical implication of this is that you should only edit any given dive on one platform between syncs (you can edit different dives and all the changes will come through as expected). The other part of the sync process deals with additional and deletions. This is actually a tricky operation, but basically, Diving Log 5.0 looks at records (base on the globally unique identifier) that exist on one side but not on the other and makes a determination about if this record should be added or deleted in conjunctions with some database wide timestamp information that is also kept.

There are a couple of practical implications of this syncing (this is true of any syncing you do between your iPad and PC) is that your clocks on the two devices need to be reasonably close (most devices use a web based service or cell service information to set their clocks accurately so this is rarely a concern). If the clocks on your iPad and PC are radically different then it is possible that a change you made later on one device might have an earlier timestamp that a change you made earlier on the other device. Given that we humans are not that fast, this would require the clocks to be off by quite a bit. The other practical implication is that any record (a dive for example) must be created on one platform and synced to the other to be treated as the same record (dive in this case). The reason for this is that when a record is created, it is assigned a globally unique identifier and that is what is used to determine if that record is the same as the one that exists on the other platform. Diving Log 5.0 has a special feature when importing dives from a dive computer or external file that allows you to "merge" the dive data being imported with specific dives that already exists in Diving Log 5.0. This allows you to create dives on the iPad in the field, sync them to the PC and then import your dive computer and have the additional information (profiles, temperatures, tank pressures, etc.) integrated into the existing dive (thereby preserving the globally unique identifier).

The other thing to keep in mind are the differences in what happens when you sync in each direction. If all you want to do is make your iPad look just like your PC currently looks then you want to just sync from your PC to your iPad and then press the "Use new Logbook" button on the iPad. This will replace everything on your iPad with the data currently on your PC. If you want to make sure that changes you made on your iPad are integrated into the database on the PC and the changes on the PC are integrated on the iPad then you need to:

1) Sync from the iPad to the PC
2) Sync from the PC to the iPad
3) Press the "use new Logbook" button on the iPad

I can't explain why you saw what you did, but I'd suggest that your incremental sync's to the iPad should not have been necessary. Once you had the data the way you wanted in on the PC and then just synced from the PC to the iPad them each of those operations simply replaced the previous database on the iPad with a new one from the PC with the final one having all the data (if you had synced the final one first the result would have, or at least should have, been the same).

I hope that background proves helpful for you in the future. I'm sorry for the difficulties that you experienced and we'll continue to try to sort out what might have happened between the two programs to cause the issues that you saw.

Cheers,

Greg

Greg McLaughlin
More Mobile Software
www.moremobilesoftware.com
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Re: Information not showing on iPad

Post by Huub »

Hi Greg,

Thanks for the elaborate and very informative answer. In general I sussed out the way things were supposed to be taking place, with the exception of the way information is not merged when moving data to the iPad. I must say I was totally at a loss why the only way to get things correctly transfered to the iPad was in fact doing the incremental procedure.

I must admit that because I wanted things speeded up a little bit, I edited the information in de DB on the PC directly using Access. Noticing the timestamp that is used in the individual records, I even performed an update query to make absolutely sure that all records on the PC had a newer timestamp than the records on the iPad (not being aware that in that direction the records on the PC would be leading anyway) before attempting the transfer to the iPad.

Looking at things from a pragmatic perspective... it works now and record changes I couldn't do earlier, now work perfectly well. What has happened?... I'm at a loss and I can't reproduce any of the earlier issues any more. If I notice any other possible anomalies, I'll try to document properly and inform you and Sven about it. It's the least I can do when I see what excellent support you both are providing for your respective software.

Looking forward to make use of both packages during and after my next divetrip in two weeks time and thanks again for the almost instantaneous reactions to my call for help from the both of you.

Regards,
Huub
gregm
Posts: 63
Joined: Tue Jan 06, 2009 23:04
Location: Bellingham, WA, USA
Contact:

Re: Information not showing on iPad

Post by gregm »

Thanks Huub,

I don't know for sure of course, but it is possible that the time stamps of the records that you manually updated in Access were incorrect in some way. One possibility is that the format was not exactly right (Dive Log and Diving Log are sensitive to the format as they need to work on multiple platforms so we strictly follow a specific standards based time stamp format). The other possibility is that the time basis for the time stamps was wrong. We base all our time stamps on GMT (Zulu time base) so that we can deal with iPad and iPhone that tend to travel the world before being synced. We do not encode the time basis in the time stamp though as it is defined to GMT in our DB format. This can make it very hard to look at a time stamp and be sure that it is "right" (many of the tools that let you look at time stamps, at least on the Mac, tend to convert them to local time but the "raw" text time stamps will still be in GMT).

Regardless, I'm glad that it is working for you now. By all means, let us know if you see anything else strange.

Cheers,

Greg
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Re: Information not showing on iPad

Post by Huub »

Hi Greg,

I used the timestamp in the table 'Logbook' field 'Updated' in the format '3-4-2012 23:55:00'. I used local time there, but that is GMT-2 (daylight saving time in western-Europe) and I'm absolutely sure that was well up from any other timestamp in any record previously used when exporting to iPad. In any way, I still have original DB where things went haywire. Upcoming weekend, I will try if I can reproduce the erroneous export using that version of the DB. If the problems persist in that version, I could make that DB available for troubleshooting. If it works correctly, then I'm puzzled and will have to do some more personal reflection on what I did wrong myself :oops:

Regards,
Huub
gregm
Posts: 63
Joined: Tue Jan 06, 2009 23:04
Location: Bellingham, WA, USA
Contact:

Re: Information not showing on iPad

Post by gregm »

Hi Huub,

Again, I have no idea if the time stamps are the issue so this might all be an academic exercise, but the format expected within the SQLite database is: "yyyy-MM-dd'T'HH:mm:ss". This format is pretty strict within the iOS app but there may be more flexibility in Diving Log 5.0 where the actual comparison of the time stamps takes place. The time stamp format might actually be stored differently within the Access database than it is in the SQLite database (the SQLite database is the one actually used for exchange between the devices) so the time stamp that you used might be perfectly fine (Sven would need to comment on that). As a side note, SQLite does not have a formal "date" data type, but rather dates are stored in text fields and are handled internally by Dive Log and Diving Log 5.0. I believe that Access does have a formal date type and I'm not sure if Diving Log 5.0 uses that or if it uses a text field and handles the dates internally like it does with the SQLite database.

The time stamp that I'd expect to have seen (based on your example) would have looked like: 2012-03-04T23:55:00 (again, this would be in the SQLite file). My best guess is that if the time stamp were not in the format that was expected that it would have been interpreted as "no time stamp" and would have been considered to have happened before any event with a time stamp.

I figure that if you are going to have another look at your earlier DB that this might be helpful background.

Cheers,

Greg
Huub
Posts: 6
Joined: Mon Apr 02, 2012 20:59

Re: Information not showing on iPad

Post by Huub »

Hi Greg,

I made a quick check on the timestamp in sql-format: it's exactly as you indicated it should be: 2012-03-04T23:55:00, so no indication it has gone wrong there. The try on reproducing the error with the original DB will have to wait until the weekend.

Thanks again for elaborating on the background of what is going on behind the scenes.

Regards,
Huub
Post Reply