Integration of several Libraries

It could be demanded that the app needs to be measured on several markets. In this case the most recent version of the Mobile App Sensor needs to be integrated for every single market with the corresponding implementation instructions. Spring measurement libs for variant clients had been unified to one, and of course the customized settings are applied based on the different domains internally.

 

From version 1.1.0 on this is supported through a different naming and a changed package structure. In the following examples are the libs for market MA and market MB. Concerning the naming the following structure must be used

spring-appsensor-<OS>-<MARKET>-<VERSION>

Examples:

  • spring-appsensor-iOS-MA-1.1.0.zip
  • spring-appsensor-android-MB-1.1.0.zip

 

The zip file we released will contain the spring measurement lib, possibly the necessary utility lib and corresponding API doc.

Please consider the implementation instructions of the single libraries. Those may be differ (strongly) on the single markets.

 

Integration of libraries with iOS

In the following example the library of the markets MA is integrated. The header file is needed:

  • Spring.h

#import "TestApp.h"

#import "Spring.h"

@implementation TestApp3AppDelegate

@synthesize window = _window;
@synthesize tabBarController = _tabBarController;


Spring *spring;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    // --- MA ---------------------------------------------------------------------------------

    spring = [[Spring alloc] initWithSiteAndApplication:@"site" application:@"applicationName"];


    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:SPRING_APP_STARTED, SPRING_VAR_ACTION,nil];

    [spring commit:dict];



    self.window.rootViewController = self.tabBarController;

    [self.window makeKeyAndVisible];

    return YES;
}


// ... more code 

Integration of library with Android

In the following example the library of themarkets MA is integrated. The corresponding java Class in jar file is needed:

  • de.spring.mobile.SpringMobile

 

package de.spring.android.test;

import java.util.HashMap;
import java.util.Map;

import de.spring.mobile.SpringMobile;


import android.app.Activity;

public class MyActivity extends Activity {
	
	SpringMobile ma;
	
	public MyActivity() {
		ma = new SpringMobile("site", "applicationname", getApplicationContext());
	}
	
	/**
	 * @see android.app.Activity#onStart()
	 */
	@Override
	protected void onStart() {
		
		Map<String, Object> mapma = new HashMap<String, Object>();
		mapma.put(SpringMobile.VAR_ACTION, SpringMobile.APP_STARTED);
    	ma.commit(mapma);
 
	}
 
	// more code ...
}