Sample Windows Phone 7 app

skeleton.app.cs
 public partial class App : Application
    {
        public LocalyticsSession appSession;
 
        /// <summary>
        /// Provides easy access to the root frame of the Phone Application.
        /// </summary>
        /// <returns>The root frame of the Phone Application.</returns>
        public PhoneApplicationFrame RootFrame { get; private set; }
 
        public App()
        {
        }
 
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            appSession = new LocalyticsSession("511a40c50cec4748efde88f-6556cfb0-d982-11de-ae9c-00412a747c4c");
            appSession.open();
            appSession.upload();
        }
 
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            appSession = new LocalyticsSession("511a40c50cec4748efde88f-6556cfb0-d982-11de-ae9c-00412a747c4c");
            appSession.open();
            appSession.upload();
        }
 
        private void Application_Deactivated(object sender, DeactivatedEventArgs e)
        {
            appSession.close();
        }
 
        private void Application_Closing(object sender, ClosingEventArgs e)
        {
            appSession.close();
        }
 
        private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
        }
 
        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            Dictionary<String, String> attributes = new Dictionary<string,string>();
            attributes.Add("exception", e.ExceptionObject.Message);
            appSession.tagEvent("App crash", attributes);
        }
    }