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:
- SpringMA.h
#import "TestApp.h" #import "SpringMA.h" @implementation TestApp3AppDelegate @synthesize window = _window; @synthesize tabBarController = _tabBarController; SpringMA *springMA; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // --- MA --------------------------------------------------------------------------------- springMA = [[SpringMA alloc] initWithSiteAndApplication:@"site" application:@"applicationName"]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:MA_SPRING_APP_STARTED, MA_SPRING_VAR_ACTION,nil]; [springMA 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 jar file is needed:
- de.spring.mobile.ma.SpringMA
package de.spring.android.test; import java.util.HashMap; import java.util.Map; import de.spring.mobile.ma.SpringMobileMA; import android.app.Activity; public class MyActivity extends Activity { SpringMobileMA ma; public MyActivity() { ma = new SpringMobileMA("site", "applicationname", getApplicationContext()); } /** * @see android.app.Activity#onStart() */ @Override protected void onStart() { Map<String, Object> mapma = new HashMap<String, Object>(); mapma.put(SpringMobileMA.VAR_ACTION, SpringMobileMA.APP_STARTED); ma.commit(mapma); } // more code ... }