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.
From version 1.1.0 on this is supported through a different naming and a changed package structure. In the following examples both markets market MA and market MB are integrated. Concerning the naming the following structure must be used:
spring-appsensor-<OS>-<MARKET>-<VERSION>
Examples:
- spring-appsensor-android-MA-1.1.0.jar
- spring-appsensor-iOS-MA-1.1.0.zip
Please consider the implementation instructions of the single libraries. Those may be differ (strongly) on the single markets.
Integration of several Libraries with iOS
In the following example the libraries of the two markets MA and MB are integrated. Therefore the two header files:
- SpringMA.h
- SpringMB.h
#import "TestApp.h" #import "SpringMA.h" #import "SpringMB.h" @implementation TestApp3AppDelegate @synthesize window = _window; @synthesize tabBarController = _tabBarController; SpringMA *springMA; SpringMB *springMB; - (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]; // --- MB --------------------------------------------------------------------------------- springMB = [[SpringMB alloc] initWithSiteAndApplication:@"site" 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 several Libaries with Android
In the following example the libraries of the two markets MA and MB are integrated. Therefore the two java classes:
- de.spring.mobile.ma.SpringMA
- de.spring.mobile.mb.SpringMB
package de.spring.android.test; import java.util.HashMap; import java.util.Map; import de.spring.mobile.ma.SpringMobileMA; import de.spring.mobile.mb.SpringMobileMB; import android.app.Activity; public class MyActivity extends Activity { SpringMobileMA ma; SpringMobileMB mb; public MyActivity() { ma = new SpringMobileMA("site", "applicationname", getApplicationContext()); mb = new SpringMobileMB("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_BACKGROUND); ma.commit(mapma); Map<String, Object> mapmb = new HashMap<String, Object>(); mapmb.put(SpringMobileMB.VAR_ACTION, SpringMobileMB.APP_BACKGROUND); mb.commit(mapmb); } // more code ... }