Friday, August 15, 2008

MyExperience Script Playground

MyExperience uses a heavily modified version of the Simkin scripting language described on our Wiki here. I've uploaded a program for Windows, called ScriptWindow, to the Wiki. ScriptWindow allows you to play around with the scripting language a bit and get used to its syntactical structure. Note that this runs in Windows (e.g., XP or Vista) and not on the device. Thus, it's a nice little sandbox with which to experiment with loops and conditions among other operations.


You can download ScriptWindow here.

Troubleshooting

When dealing with technology, inevitably not everything works the way we expect it or want it to. MyExperience offers a few ways of tracking down errors, which are described in the Troubleshooting section of the How do I? documentation on the Wiki.

If you are experiencing an issue with MyExperience, the easiest and fastest remedy may be to email the MyExperience Users mailing list (sign up here, view archives here) with a description and log file of your problem. The log file can be found on your device: \Storage Card\MyExperience\MyExperienceLog.txt.

Wednesday, August 6, 2008

MyExperience Version 0.8.2 Released

You can download version 0.8.2 of MyExperience here, which includes over 58 changes from the last release (if you want the source as well, click here).

Some of the highlights that were fixed/added in this version.
  • Quicker transitions between survey panels and the desktop toolbar no longer pops up for a few milliseconds during the transition
  • Added GetResponses() method to ExecutableBase that allows the survey designer to obtain all the responses for a given question. It returns an array of Response objects. Call Response.Value to get the raw value.
  • Fixed the IsActionTypeExecuting method so that it appropriately returns false/true
  • Fixed bug where after TimeOutForm is closed via tap/keypress, SurveyForm would not show up
  • Fixed region specific bug.. Although this was originally marked as an issue with language, it is actually an issue with the regionality configuration of the device. I blogged about this issue here.
  • Added GetTrigger() method to TriggerExecutable thereby allowing trigger scripts to get access to the trigger itself
  • Added ability to automatically change the startup image. New startup images can be defined by placing a PNG called "Startup.png" in the application directory.
  • Fixed the improper handling of negative number definitions in Simkin (e.g., i = -1 threw an exception because Simkin saw this as a subtraction sign rather than a negative sign)
  • Added the ability to get access to actions via the GetExecutingActions() and GetExecutingActionsOfType() methods in ExecutableBase
Click here for the full release notes.

Tuesday, August 5, 2008

How Do I?

Jennifer Beaudin has done a terrific job recently creating a very useful documentation section on the MyExperience Wiki called How Do I...? This is sort of like a hybrid FAQ/Getting Started guide that covers some of the most important points about MyExperience and will surely save you time if you give it a read. I strongly recommend taking a look here.

Note that the Wiki is constantly improving. As we find the time, we continue to add more helpful content and fill out incomplete sections.

Monday, March 10, 2008

Fixing Daylight Savings on Windows Mobile Devices

From Microsoft:
Observance of "Daylight Saving Time" and "Summer Time," or the shifting of clocks by one hour, does not occur uniformly in the world. Some countries and territories follow a set of standard rules for the start and end dates of Daylight Saving Time while others follow their own calendar. You can find more information about exact dates and the potential impact to your time zones in the Changes in Windows Mobile Daylight Saving Time section.
In the MyExperience tool, time is critical. It can affect when you trigger events (e.g., self-report surveys), the timstamp that the collected data is annotated with, etc. Thus, it is crucial that you install this update from Microsoft on your Windows Mobile devices before you begin your field studies.

For more information, visit the Windows Mobile Updates for Daylight Savings Time page.

Tuesday, February 26, 2008

MyExperience Version 0.8.1 Released

You can download version 0.8.1 of MyExperience here. The direct link to the default download package (which does not include source code) is here.

The Release Notes
- There was a bug in NotificationForm with regards to how Snooze was handled. I rewrote NotificationAction and NotificationForm such that the snooze functionality is now handled by NotificationAction outside of the modal dialog. This is probably how it should have been from the beginning. One relevant note is that NotificationAction assumes it is being called by a thread other than the UI thread.
- Fixed a bug in the GLOBALS subsection of the MyExperience.XML file where they appropriate values were not being seen by the application.
- Wrote a hack to force the MainForm to hide. For some reason, a simple this.Hide() or this.Visible=false; call will not work in MainForm. The menubar and titlebar refuse to hide. My hack basically grabs a handle to the desktop window and forces that to the top window.
- Added menu to LoadedSensorsForm to view properties (you could do this before by pressing the select button but that was nonintuitive)
- Added ability to slightly customize the MainForm via Global settings (e.g., you can set the left menu name, you can disable the debug menus from showing, you can disable exiting the program). The end goal, however, is still to make MainForm customization a first level object in the XML file.
- Set this.ControlBox = false on all relevant forms. This takes away the (X) in the upper-right hand corner on PocketPC devices
- Minor change to RandomTimeSensor, added readonly CurrentTimeBlock property
- Fixed LogViewerForm on PocketPCs
- Fixed GlobalsForm property view issue
- Can now access running actions from the AvailableActionsForm
- Fixed NullReferenceException bug in PropertyForm
- Added MspInstantActivitySensor whose state is a tuple where the string is the currently sensed activity and the int is the confidence score (e.g., "Walking, 89" or "Bicycling, 72"). This sensor can update its activity inference four times per second.
- Added MspMessage to create a more object oriented hierarchy around the MSP string messages received over bluetooth from the MSP device.
- Added two hsa_defs.txt files which is used by the MspHumanScaleActivitySensor. This sensor, unlike MspInstantActivitySensor, applies smoothing to activity states (thus it recognizes activities at the "human scale" rather than micro scale).
- Made sure that all connections received from Roam.SqlCe.SqlCeConnectionManager were immediately closed after usage of that connection completed. On the desktop, when using SQL lib, the correct operation is to grab a SQL connection, run a sql command (or a series of sql commands) and then immediately close the connection. On the mobile, because there is no SQL connection pool, the appropriate operation is to keep connections open as long as possible. This is because opening a connection on the mobile can take 1-2 seconds. This is not efficient. Thus, in Roam (http://www.sourceforge.net/projects/roam) I implemented my own SQL connection pool, which is also thread safe. A discussion about connection pooling and SQL thread safety on the mobile can be found on my csharponphone blog at http://csharponphone.blogspot.com/2007/01/keeping-sqlceconnection-open-and-thread.html (which was written more than a year ago now)
- Added some new debug views (e.g., one for viewing SQL information, one for viewing thread information)
- Added DownloadAction that can download an artifact (e.g., music file, image, etc.) based on a provided URL. We are currently using this in UbiGreen to download images.
- Added new overloaded SaveBinaryData method to Action class that takes in a Stream (rather than a byte array)
- Updated amount of DEBUG level logging that the DatabasePopulator class outputs. This should better help us track down issues people are having when MyExperience first starts. I also added more verbse INFO level logging to the Initialize method of MyExperienceFramework, which is automatically shown on the SplashScreen.
- Updated both the AudioRecorder and the CameraWidget so that they are more immune to accidental "double click" or "double keypress" issues.
- The AudioRecorder now has a _minimumRecordTime field (this has not been exposed as a property, however)
- Added RunningSensorCount property to SensorManager
- Updated way Globals closes its SqlConnection (it checks to see if the connection was already open on the current thread before closing it)
- Fixed a bug in SendSmsAction that was causing an exception whenever the empty constructor was used
- Added SaveResult enum that ScreenShotAction, DownloadAction, and others use as their action result
- Added MspWindowActivitySensor which just uses a moving window average for smoothing
- Added refresh menu item to LoadedSensorsForm
- Added CurrentStateDuration and PreviousStateDuration properties to Sensor
- Added new Question script type: OnCreate, which executes when the question is created
- Exposed GetQuestion in SurveyEngine such that a question can call "GetQuestion()" to get a reference to itself

Added Actions Documentation to Wiki

Slowly but surely we are moving documentation over from this PDF to the MyExperience Wiki. I just finished a draft of the Actions section complete with XML examples and screenshots. You should consult the Wiki before looking at the PDF (as the Wiki's documentation will always be more up-to-date).