locked
Some noobie questions on my first application - Configuration and syncing. RRS feed

  • Question

  • Working on my first Mobile app and have a few hopefully basic questions.  Feel free to point me to a doc, I've spent about an hour searching the web, and if I've found the answers, I haven't recognized them...

    I have application information I wish to store between runs.  This is such things as column sizes, recently used files, etc.  What is the best practice for storing this type of application specific information?

    My application needs to keep the datafiles in sync with those on a desktop.  Datafiles are simple textfiles, and my 1.0 release will support syncing in one direction (desktop overwrites mobile) only.  I would like the files to be updated anytime the device is cradled.  Is there documentation or sample code on how I can accomplish this?

    Thanks
    John Dilley
    Wednesday, August 19, 2009 12:27 AM

Answers

All replies

  • Hi,

    It might be worth taking a look at the Microsoft Sync Framework :-

    http://msdn.microsoft.com/en-us/sync/default.aspx

    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Wednesday, August 19, 2009 7:22 AM
  • I think I'm missing something obvious, probably from lack of experience.

    The Sync Framework site I had looked at, and after digging through it I found one article on sync for devices, and in the release notes it states that file syncing was not included.  All the examples appear to be ADO or SQL based, with lots of tips on keeping databases in sync. There was another long article on syncing over the air. It looks like the difficult less common scenarios are well documented, but simple file syncing we're just expected to magically know.

    In my case, I simply want to make sure that the latest version of certain files are on the mobile device anytime it is cradled.

    It sounds like an easy thing, but I must be missing some basic point.

    When cradled, what type of access to the computer does the device have? I know that the device can appear as a removable drive to the computer, can the computer be viewed by the device?

    With my Treo, I was able to set up syncs with arbitrary files that would always be kept up to date. I'm not finding anything analogous in the Winmo space.
    Thursday, August 20, 2009 6:09 AM
  • Hi John,

    There is sample code named "activesync stock portfolio sample"  in SDK, which provide service provider for Activesync.
    D:\Program Files\Windows Mobile 6 SDK\Activesync


    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Friday, August 21, 2009 8:51 AM
  • The sample once again seemed database oriented, and was c++ rather than managed.

    I think I'm working my way to a solution. Currently I'm thinking that I would develop a separate 'syncing' application that will get launched automatically when a device is connected.  I've determined how to get the application to launch, and am now exploring the best way to move the data to the device.

    RAPI seems one way, but does not appear to be managed code.  I'm now trying to determine if my windows app can treat the device using standard file system methods, and if so, whether this should work for all mobile devices that can be cradled.
    Saturday, August 22, 2009 1:37 AM
  • Hi,

    OpenNETCF provide a managed implementation of RAPI here :-

    http://www.opennetcf.com/FreeSoftware/DesktopCommunication/tabid/90/Default.aspx

    Also this might be a useful registry change to launch a desktop application when you dock your device :-

    http://pocketnow.com/tweaks-hacks/how-to-automatically-start-a-pc-application-on-device-connect-disconnect

    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    • Marked as answer by John Dilley Saturday, August 22, 2009 4:38 PM
    Saturday, August 22, 2009 7:25 AM
  • Thanks Paul.  Those links have led me to my solution.  I have a 'quick fix' based on a link they led me to.  As I surmised, it was some real basic information that was slowing me down, basically lack of documentation and information on WMDC. Since it was files I was trying to keep in sync, it turns out I can get part of the way to what I want using just that utility.  I finally discovered how file syncinc worked, and can set up a synctoy to keep the files in the PCs sync directory up to date with the latest versions of the files from the network.

    The primary difference between my syncing application and WMDC is that I will be able to setup syncing pairs which will allow me to get the files from anywhere on the network, and place them in either main storage or on a storage card on the mobile device.

    I was originally looking at the application on the device doing the syncing, without requiring a PC side component.  My best guess now is that that is not possible.

    So, to keep files in sync between a device and a mobile device, the answer boils down to either a) use built in file syncing feature of WMDC if you don't need to store to a storage card and if the files can be kept in a single place on your PC, or b) develop an app that uses RAPI to sync files from anywhere on the network to anywhere on the storage device.   This second app expanding the file syncing capabilities of WMDC seems very basic, easy to write, and I would be very surprised if someone hasn't already written one.
    Saturday, August 22, 2009 4:53 PM