Here, the default KML file and the default SMS phone number can be changed.

The default.base.directory property defines the directory where the application stores the SMS Adapter information. If a '#' is added before the property, the value is replaced with the current directory (where the application was installed):

There are several ways to obtain the modem port. In Windows Vista, the DeviceManager application can be used:

Running the Demo

To run the demo, double-click over the mesh4j-SMS-DemoApp.jar file. To use it, you must have java JDK installed in your PC. The following window will be shown:

To synchronize a KML with other KML files or with a Sync Server via HTTP you can use the "KML synchronization Group".

You should enter the endpoint1 and endpoint2 using a KML file or a sync server URL.

The button named "Synchronize" starts the synchronization process. Partial information is shown in the console view.

When the KML file is newer the file needs to be prepared for the process of synchronization. The KML Adapter adds the sync information to the KML file.

For this process you should press the "Prepare file to sync" button. If you do not prepare the file but you run the synchronization process, the KML adapter always prepares the file before the synchronization process is run.

The "Purge" button removes all the sync history with exception of the latest one.

The button "clean" removes all the sync information (clean up everything).

When the application starts up, it verifies if the modem has been plugged in (using the value in the property default.sms.port). If the modem has been plugged in the modem's name is shown in the field named "Phone". Otherwise, the word "Demo" is shown.

To synchronize a KML file with another PC via SMS, the next step is to enter the KML file to synchronize (the file must be located in the mobile phone directory, this will be discussed more in detail later in this post) and the phone number of the counterpart.

The button "Synchronization" start the synchronization process. This process could take time, but it works as an asynchronous process.

The console view shows all messages traffic, and you can see high level notifications too.

You could simulate the process with the button "Simulate" which lets you see in the console view the complete traffic of the protocol messages (no SMS messages are sent).

For test purposes you can send a message manually. First you enter the phone number and the message to send, and then press the button "send".

The console view shows notification messages of all processes running in the application (file to file synchronization, file to URL synchronization or file to file SMS synchronization).

The protocol is based on a SyncSession concept. A sync session is a session that maintain the information of the synchronization process.

A new directory for the mobile phone plugged in the PC is created on the default.base.directory. In this directory the SmsAdapter stores the sync session information. (*1)

For each session there are 2 RSS Feed files: the current session and the last session snapshot.

The file are named [sessionId]_current.xml and [sessionId]_snapshot.xml.

Each protocol message to be sent is divided in a batch of compressed messages. For assurance of the reliability of the protocol two queues are used to store in/out messages. Each queue is persisted as a Feed.