Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

An die App kann die Anforderung gestellt werden, dass sie auf mehreren Märkten gemessen werden soll. In diesem Fall muss für jeden Markt die aktuelle Version der Mess-Library mit den entsprechenden Implementierungsvorschriften integriert werden. 

Ab der Version 1.1.0 wird dies durch eine veränderte Namensgebung und eine veränderte Packagestruktur unterstützt. In den folgenden Beispielen werden die beiden Märkte MA und MB integriert. Bei der Namesgebung der Libraries gilt folgende Struktur: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>-<MARKT><MARKET>-<VERSION>

BeispieleExamples:

  • spring-appsensor-androidiOS-MA-1.1.0.jarzip
  • spring-appsensor-iOSandroid-MAMB-1.1.0.zip

 

WarningBeachten Sie die Implementierungsvorschriften für die einzelnen Libraries. Diese können sich (stark) auf den einzelnen Märkten unterscheiden

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

Warning

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

 

Integration

...

Im folgenden Beispiel werden die Libraries der beiden Märkte MA und MB integriert. Hierzu müssen die beiden Headerdateien:

  • SpringMA.h
  • SpringMB.h
angegeben werden.

of libraries with iOS

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

  • Spring.h

Code Block
#import "TestApp.h"

#import "SpringMA.h"
#import "SpringMBSpring.h"

@implementation TestApp3AppDelegate

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


SpringMASpring *springMAspring;
SpringMB
*springMB;

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

{

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

    springMAspring = [[SpringMASpring alloc] initWithSiteAndApplication:@"sitenamesite" application:@"applicationName"];


    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:MA_SPRING_APP_STARTED, MA_SPRING_VAR_ACTION,nil];

    [springMAspring commit:dict];



  // --- MB ---------------------------------------------------------------------------------

    springMB = [[SpringMB alloc] initWithSiteAndApplication:@"sitename" application:@"applicationname"];

    dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:MB_SPRING_APP_STARTED,MB_SPRING_VAR_ACTION,nil];

    [springMB 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.ma.SpringMA
  • de.spring.mobile.mb.SpringMB
benutzt werden.
  • SpringMobile

 

Code Block
package de.spring.android.test;

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

import de.spring.mobile.ma.SpringMobileMA;
import de.spring.mobile.mb.SpringMobileMBSpringMobile;


import android.app.Activity;

public class MyActivity extends Activity {
	
	SpringMobileMASpringMobile ma;
	SpringMobileMB
mb;
	
	public MyActivity() {
		ma = new SpringMobileMA("sitename", "applicationname", getApplicationContext());
		mb = new SpringMobileMB("sitenameSpringMobile("site", "applicationname", getApplicationContext());
	}
	
	/**
	 * @see android.app.Activity#onStart()
	 */
	@Override
	protected void onStart() {
		
		Map<String, Object> mapma = new HashMap<String, Object>();
		mapma.put(SpringMobileMASpringMobile.VAR_ACTION, SpringMobileMASpringMobile.APP_BACKGROUNDSTARTED);
    	ma.commit(mapma);
 
		Map<String, Object> mapmb = new HashMap<String, Object>();
		mapmb.put(SpringMobileMB.VAR_ACTION, SpringMobileMB.APP_BACKGROUND);
    	mb.commit(mapmb);
	}
 
	// more code ...
}