Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CP-Beispielblock hinzugefĆ¼gt

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.

Code Block
languagecsharp

/*
 * 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);
Code Block
languagecsharp
/*
 * Example CP
 */
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("cp", "Mainpage");
spring.commit(target);
...
/*
Info

If the device ID should be readed, the right of reading this ID needs to be entered in a config file (WMAppManifest.xml).

Code Block
langugagexml

...
<Capabilities>
...
<Capability Name="ID_CAP_IDENTITY_DEVICE"/> ...
</Capabilities>
...