Description of the Mobile App Library Interface

This chapter describes the interface of the Mobile App Sensor exemplarily for all platforms. For explanation the pragramming language java is used. However the function names are the same in any supported platform and their programming language.

public class SpringMobile {

   /** Is sent when the application is started. */
   public static final String APP_STARTED = "spring.STARTED";

   /** Is sent when the application is put into the background. */
   public static final String APP_BACKGROUND = "spring.BACKGROUND";

   /** Is sent when the application is taken into the foreground. */
   public static final String APP_FOREGROUND = "spring.FOREGROUND";

   /** Is sent when the application is closed or finished. */
   public static final String APP_CLOSED = "spring.CLOSED";

   /** The variable for the sending of activities */
   public static final String VAR_ACTION = "ac";

   /**
    * Constructor with mandatory declaration of a website identification
    * and the application name.
    */
   public SpringMobile(String site, String application) { }

   /**
    * By calling this method, all the name-value-pairs
    * of the {@ link map} are sent to the measuring system.
    *
    * @param target A map with all name-value-pairs.
    */
   public void commit(Map<String,String> target) { }

   /**
    * When the value <code>false</code> is specified, 
    * the sending of requests to the measuring system is switched off
    * This value is <code>true</code> by default.
    */
   public void setTracking(boolean tracking) { }

   /**
    * Delivers the value <code>true</code> when the tracking
    * is activated, otherwise the value is <code>false</code>.
    */
   public boolean isTracking() { }
}

The interface is basically the same on all platforms. The specifics and an example code can be found in the corresponding chapters on the platforms.
For the installation generally applies:

  • Create an object SpringMobile with the application name and the website name. (The website name is provided with the library)
  • For defined actions, call the method commit(...) with the appropriate variables and values.