...
Info | ||
---|---|---|
| ||
At the application start the Spring object has to be instanced one-time and to be used for the whole life cycle of the application |
Example
Code Block | ||
---|---|---|
| ||
/* * Importing SpringMobile */ #import "Spring.h" /* * Providing entity */ Spring *spring; /* * Generating SpringMobile entity with site id and * application name */ spring = [[Spring alloc] initWithSiteAndApplication:@"<site>" application:@"myApplication1"]; /* * Sending the start of the application to the measurement system */ NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:APP_STARTED,VAR_ACTION,nil]; [spring commit:dict]; ... // OR /* * Sending the action spring.BACKGROUND */ NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:APP_BACKGROUND,VAR_ACTION,nil]; [spring commit:dict]; |
...
The following example shows the basic installation for the Android platform. When generating the class SpringMobile
a site identifier (<site>) has to be indicated, which is shipped together with this documentation and the libraries.
Example
...
Code Block | ||
---|---|---|
| ||
/** * Importing SpringMobile */ import de.spring.mobile.SpringMobile; /** * Generating SpringMobile entity with site id and * application name */ SpringMobile spring = new SpringMobile("<site>", "Application Name", getApplicationContext()); /** * Sending the start of the application to the measurement system */ Map<String, Object> map = new HashMap<String, Object>(); map.put(SpringMobile.VAR_ACTION, SpringMobile.APP_STARTED); spring.commit(map); /* * Sending the action spring.BACKGROUND */ Map<String, Object> map = new HashMap<String, Object>(); map.put(SpringMobile.VAR_ACTION, SpringMobile.APP_BACKGROUND); spring.commit(map); |
...
Code Block | ||
---|---|---|
| ||
/** * Example AC */ import de.spring.mobile.SpringMobile; /** * Generating SpringMobile entity with site id and application name */ SpringMobile spring = new SpringMobile("<site>", "Application Name", getApplicationContext()); /** * Sending AC to the measurement system */ Map<String, Object> map = new HashMap<String, Object>(); map.put("ac", "Mainpage"); spring.commit(map); |
...
Android Permissions
The following settings need to be conducted in the file AndroidManifest.xml AndroidManifest.xml
:
...