package com.bluecats.services;

import com.bluecats.sdk.BlueCatsSDK;
import com.bluecats.services.interfaces.BlueCatsSDKInterfaceService;

import android.app.Application;
import android.content.Intent;
import android.os.Bundle;

public class MainApplication extends Application {
	protected static final String TAG = "MainApplication";
	
	private static final String BLUECATS_APP_TOKEN = "2cac72de-8100-4b19-b601-26290e98fb13";

	@Override
	public void onCreate() {
		super.onCreate();

		// start the BlueCatsSDKInterfaceService
		// this service will be responsible for handling SDK events while the app is closed
		Intent intent = new Intent(MainApplication.this, BlueCatsSDKInterfaceService.class);
		Bundle extras = new Bundle();
		extras.putString(BlueCatsSDK.EXTRA_APP_TOKEN, BLUECATS_APP_TOKEN);
		intent.putExtras(extras);
		startService(intent);
	}
}

@@ -220,16 +220,47 @@
 .Bundle;
+%0Aimport android.text.TextUtils;
 %0A%0Apublic
@@ -417,44 +417,8 @@
  = %22
-2cac72de-8100-4b19-b601-26290e98fb13
 %22;%0A%0A
@@ -475,16 +475,156 @@
 ate();%0A%0A
+%09%09if (TextUtils.isEmpty(BLUECATS_APP_TOKEN)) %7B%0A%09%09%09throw new RuntimeException(%22BLUECATS_APP_TOKEN is invalid in MainApplication.java.%22);%0A%09%09%7D%0A
 %09%09// sta

throw an exception if app token is null