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 both markets are the libs for market MA and market MB are integrated. Concerning Concerning the naming the following structure must be used:
spring-appsensor-<OS>-<MARKET>-<VERSION>
Examples:
- spring-appsensor-androidiOS-MA-1.1.0.jarzip
- spring-appsensor-iOSandroid-MAMB-1.1.0.zip
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 of
...
libraries with iOS
In the following example the libraries library of the two markets MA and MB are is integrated. Therefore the two header files:
...
The header file is needed:
- Spring.h
Code Block |
---|
#import "TestApp.h" #import "SpringMASpring.h" #import "SpringMB.h" @implementation TestApp3AppDelegate @synthesize window = _window; @synthesize tabBarController = _tabBarController; SpringMASpring *springMA; SpringMB *springMBspring; - (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]; [springMA commit:dict]; // --- MB --------------------------------------------------------------------------------- springMB = [[SpringMB alloc] initWithSiteAndApplication:@"sitename" application:@"applicationname"]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:MB_SPRING_APP_STARTED,MB_SPRING_VAR_ACTION,nilspring commit:dict]; [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 libraries library of the two markets MA and MB are integrated. Therefore the two java classesthemarkets MA is integrated. The corresponding java Class in jar file is needed:
- de.spring.mobile.ma.SpringMA
- de.spring.mobile.mb.SpringMB
...
- 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 SpringMobileMASpringMobile("sitenamesite", "applicationname", getApplicationContext()); mb = new SpringMobileMB("sitename", "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 ... } |