Working with the HUPA Source Code

Obtaining the Source Code

The source code for the HUPA project is kept in a subversion repository. To download the code you will need to install  Subversion. Follow the instructions on the site to download and install the latest version.

After installing Subversion, create a folder for the project. Then right click on the folder and choose "SVN Checkout...". The URL of the repository is:  https://www.sharedrecords.org/svn/mobile. Choose "HEAD Revision" and click "OK". The code will be downloaded into your local directory.

Setting up Visual Studio to Build and Run the Application

Building the source code requires Visual Studio 2005. In addition you will need the  Windows Mobile 5 SDK installed. Download it from the site and follow the instructions to install.

Building the Application

The main entry point for the application is the HUPA.sln file located at [Source Root]\HUPA\src\HUPA\HUPA.sln. This file opens the Visual Studio solution which has the correct references to the other projects.

From Visual Studio the easiest way to run the application is from the main menu to choose Debug-->Start Debugging. This will bring up a window asking where to deploy the application. If you have a Windows Mobile device connected to your PC you can choose "Windows Mobile 5.0 Pocket PC Device". Otherwise choose "Windows Mobile 5.0 Pocket PC Emulator".

The initial application is seeded with one login (Username: hupa, Password: hupa). This should allow you to log in and use the application. From inside the application new logins can be created from User-->Create User.

Setting up a PC to Enable Data Synchronization

Synchronization is supported on a PC via a web services API. The easiest way to set this up is to run the HUPA application from inside Visual Studio. One of the tasks this will do is publish a web site that provides the synchronization API's. Alternatively, you can manually right-click on the SyncWebsite inside the project and choose "Publish Web Site". This should publish the site on the local machine, and will show a URL that can be used to access the website.

By default data will be stored in two files: "hupa-interations.txt", and "hupa-interaction-values.txt". These files are comma separated replicas of the information stored in each interaction. They will be stored on the local machine in the C:\ directory. In order to store them in a different location you must edit the App.config file's LocalSyncDirectory entry to point to your a new directory and save a copy of this config file in the C:\ directory.

Configuring the Mobile Device to Perform Synchronization

Once you have set up a PC to allow data synchronization, you must edit the App.config file in the HUPA project, and change the "SyncURL" key to point to the web site you published locally. You must use a specific IP address, as localhost may not work.

Setting up Automatic Data Synchronization On the Mobile Device

The following steps describe how to setup the application to perform automatic synchronization whenever the device is connected to a PC. Alternatively, you can manually choose File-->Synchronize Data from the main application when the device is connected and skip these steps. This assumes you have already set up a synchronization website on your PC and configured the device properly, as described above.

In addition to the main solution, there are two other projects used for the synchronization API's. These are located at [Source Root]\HUPA\SyncApplication?\src\SyncApplication?\SyncApplication.sln and [Source Root]\HUPA\SyncApplication?\src\SyncApplication?\SyncSetup?\SyncSetup.sln.

In order to setup data automatic synchronization you will need to deploy both of these application to the Mobile Device. This can be done by opening each solution and choosing "Build-->Deploy Solution". Do not run or debug the SyncSetup application as this will cause extra synchronization events to be triggered each time the device connects.

Once these two applications have been deployed, on the mobile device navigate to the location of the application (C:\Program Files\hupa) and run SyncSetup.exe only once. The next time you connect the device to a PC, data synchronization should be performed automatically.