...
-keep class de.spring.** { *; }
-keep class de.spring.** { *; }
-keep class org.apache.** { *; }
Implementation Blackberry
The following example shows the basic installation for the Blackberry 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 | ||
---|---|---|
| ||
/**
* Importing SpringMobile
*/
import de.spring.mobile.SpringMobile;
/**
* 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
*/
Hashtable target = new Hashtable();
target.put(SpringMobile.VAR_ACTION, SpringMobile.APP_STARTED);
try {
// ...
spring.commit(target);
} catch (ParamNotSupportedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
/**
* Sending the action spring.BACKGROUND
*/
Hashtable target = new Hashtable();
target.put(SpringMobile.VAR_ACTION, SpringMobile.APP_BACKGROUND);
try {
spring.commit(target);
} catch (ParamNotSupportedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
 |
Code Block | ||
---|---|---|
| ||
/**
* Alternative method
* Sending the action spring.BACKGROUND with own
* connection parameters
*/
Hashtable target = new Hashtable();
target.put(SpringMobile.VAR_ACTION, SpringMobile.APP_BACKGROUND);
Hashtable bbprops = new Hashtable();
bbprops.put("deviceside", "true");
try {
spring.commit(bbprops,target);
} catch (ParamNotSupportedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
|
Example: Implementation of an app page request via the action variable (ac)
Code Block | ||
---|---|---|
| ||
/**
* example AC
*/
Hashtable target = new Hashtable();
target.put("ac", "Mainpage");
try {
// ...
spring.commit(target);
} catch (ParamNotSupportedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
|
Info |
---|
Although the library provides the possiblity of using connection parameters, it is highly recommended to use "spring.commit(Hashtable target)". While using connection parameters that are not supported a respective exception is thrown. |
Implementation Windows Phone
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 | ||
---|---|---|
| ||
/*
* 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: Implementation of an app page request via the action variable (ac)
Code Block | ||
---|---|---|
| ||
/*
* Example AC
*/
using spring_mobile_wp7;
/*
* Generating SpringMobile entity with site id and application name
*/
SpringMobile spring = new SpringMobile("<site>", "myApplication1");
/*
* Sending AC to the measurement system
*/
Dictionary<String, String> target = new Dictionary<string, string>();
target.Add("ac", "Mainpage");
spring.commit(target);
...
/*
|
Info | |||||
---|---|---|---|---|---|
For the measurement we need the device ID. Please set the right for reading the device ID into a config file (WMAppManifest.xml).
|
Implementation Titanium (not supported at the moment)
Include Page | ||||
---|---|---|---|---|
|