Versions Compared

Key

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

...

Code Block
#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:@"sitenamesite" application:@"applicationName"];


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

    [springMA commit:dict];

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

    springMB = [[SpringMB alloc] initWithSiteAndApplication:@"sitenamesite" 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 

...

 

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.SpringMobileMB;


import android.app.Activity;

public class MyActivity extends Activity {
	
	SpringMobileMA ma;
	SpringMobileMB mb;
	
	public MyActivity() {
		ma = new SpringMobileMA("sitenamesite", "applicationname", getApplicationContext());
		mb = new SpringMobileMB("sitenamesite", "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 ...
}