Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Example:

Code Block
languagejava

/**
 * 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);

Example CP:

Code Block
languagejava
/**
 * Example CP
 */
import de.spring.mobile.SpringMobile;

/**
 * Generating SpringMobile entity with site id and application name
 */
SpringMobile spring = new SpringMobile("<site>", "Application Name", getApplicationContext());

/**
 * Sending CP to the measurement system
 */
Map<String, Object> map = new HashMap<String, Object>();
map.put("cp", "Mainpage");
spring.commit(map);

 

The following settings need to be conducted in the file AndroidManifest.xml AndroidManifest.xml:

Code Block
languagexml

<uses-permission android:name="android.permission.READ_PHONE_STATE">
</uses-permission>
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>

...

With this value, a timeout (in seconds) for each HTTP request can be configured within the library.

Code Block
languagejava

SpringMobile spring = new ("app","TestApp",getApplicationContext());
spring.setTimeout(30); // in seconds