Implementation Windows Phone 7
The following example shows the basic installation for the Windows Phone 7 platform. When generating the class SpringMobile
a site identifier (<site>) has to be indicated, which is shipped together with this documentation and the libraries.
/* * Importing SpringMobile */ using spring_mobile_wp7; /* * Generating SpringMobile entity with site id and * application name */ SpringMobile spring = new SpringMobile("<site>", "myApplication1"); /* * Sending the start of the application to the measurement system */ Dictionary<String, String> target = new Dictionary<string, string>(); target.Add(SpringMobile.VAR_ACTION, SpringMobile.APP_STARTED); spring.commit(target); ... /* * Sending the action spring.BACKGROUND */ Dictionary<String, String> target = new Dictionary<string, string>(); target.Add(SpringMobile.VAR_ACTION, SpringMobile.APP_BACKGROUND); spring.commit(target);
example CP
/* * Example CP */ using spring_mobile_wp7; /* * Generating SpringMobile entity with site id and application name */ SpringMobile spring = new SpringMobile("<site>", "myApplication1"); /* * Sending CP to the measurement system */ Dictionary<String, String> target = new Dictionary<string, string>(); target.Add("cp", "Mainpage"); spring.commit(target); ... /*
For the measurement we need the device ID. Please set the right for reading the device ID into a config file (WMAppManifest.xml).
... <Capabilities> ... <Capability Name="ID_CAP_IDENTITY_DEVICE"/> ... </Capabilities> ...