// Path: source/src/main/java/com/apigee/sdk/ApigeeClient.java
// public class ApigeeClient {
// 	
//     /**
//      * Default tag used for logging
//      */
// 	public static final String LOGGING_TAG  = "APIGEE_CLIENT";
// 	/**
//      * Most current version of the Apigee Android SDK
//      */
//     public static final String SDK_VERSION  = "2.0.14";
//     /**
//      * Platform type of this SDK
//      */
// 	public static final String SDK_TYPE     = "Android";
// 
// 	private ApigeeDataClient dataClient;
// 	private ApigeeMonitoringClient monitoringClient;
// 	private AppIdentification appIdentification;
// 
// 	
//     /**
//      * Instantiate client for a specific app.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, Context context) {
//     	this(organizationId,applicationId,null,null,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, and specify options for App Monitoring.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param monitoringOptions the options for application monitoring
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, MonitoringOptions monitoringOptions, Context context) {
//     	this(organizationId,applicationId,null,monitoringOptions,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, and specify an alternative baseURL for requests.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param baseURL the base URL to use for server communications
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, String baseURL, Context context) {
//     	this(organizationId,applicationId,baseURL,null,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, with an alternative baseURL for requests and options for
//      * App Monitoring.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param baseURL the base URL to use for server communications
//      * @param monitoringOptions the options for application monitoring
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, String baseURL, MonitoringOptions monitoringOptions, Context context) {
//     	appIdentification = new AppIdentification(organizationId,applicationId);
//     	
//     	boolean urlSpecified = false;
//     	
//     	if ((baseURL != null) && (baseURL.length() > 0)) {
//     		urlSpecified = true;
//     		appIdentification.setBaseURL(baseURL);
//     	} else {
//     		appIdentification.setBaseURL(ApigeeDataClient.PUBLIC_API_URL);
//     	}
//     	
//         dataClient = new ApigeeDataClient(organizationId,applicationId,null,context);
//         Log.d(LOGGING_TAG,"dataClient created");
//         
//         if (urlSpecified) {
//         	dataClient.setApiUrl(baseURL);
//         }
// 
//         if ((monitoringOptions != null) && monitoringOptions.getMonitoringEnabled()) {
//         	monitoringClient = AppMon.initialize(appIdentification, dataClient, context, monitoringOptions);
//         	if( monitoringClient != null ) {
//         		Log.d(LOGGING_TAG,"monitoringClient created");
//         		ApigeeDataClient.setLogger(monitoringClient.getLogger());
//         	} else {
//         		Log.d(LOGGING_TAG,"unable to create monitoringClient");
//         		ApigeeDataClient.setLogger(new DefaultAndroidLog());
//         	}
//         } else {
//         	monitoringClient = AppMon.initialize(appIdentification, dataClient, context, monitoringOptions);
//         	if( monitoringClient != null ) {
//         		Log.d(LOGGING_TAG,"monitoringClient created");
//         		ApigeeDataClient.setLogger(monitoringClient.getLogger());
//         	} else {
//         		Log.d(LOGGING_TAG,"unable to create monitoringClient");
//         		ApigeeDataClient.setLogger(new DefaultAndroidLog());
//         	}
//         }
//     }
// 
//     /**
//      * Retrieve the instance of DataClient to use for data operations.
//      * 
//      * @return DataClient object
//      */
//     public ApigeeDataClient getDataClient() {
//     	return dataClient;
//     }
//     
//     /**
//      * Retrieve the instance of MonitoringClient to use for App Monitoring operations.
//      * 
//      * @return MonitoringClient object
//      */
//     public ApigeeMonitoringClient getMonitoringClient() {
//     	return monitoringClient;
//     }
//     
//     /**
//      * Retrieve the attributes that collectively identify the current application.
//      * 
//      * @return AppIdentification object
//      */
//     public AppIdentification getAppIdentification() {
//     	return appIdentification;
//     }
// }


import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import com.apigee.fasterxml.jackson.databind.JsonNode;
import com.apigee.sdk.ApigeeClient;
import com.apigee.sdk.apm.android.Log;
import com.apigee.sdk.data.client.DataClient;
import com.apigee.sdk.data.client.callbacks.ApiResponseCallback;
import com.apigee.sdk.data.client.entities.Entity;
import com.apigee.sdk.data.client.response.ApiResponse;
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;
package com.apigee.appservices.android_template;



	
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final TextView text = (TextView) findViewById(R.id.mainActivityText);
        
    /* 
        1. Set your account details in the app

        - Enter your ORGNAME below� it's the username you picked when you signed up at apigee.com
        - Keep the APPNAME as 'sandbox': it's a context we automatically created for you.
          It's completely open by default, but don't worry, other apps you create are not!      */
        
        String ORGNAME = "YOUR-ORG"; // <-- Put your username here!!!
        String APPNAME = "sandbox";
        
// Path: source/src/main/java/com/apigee/sdk/ApigeeClient.java
// public class ApigeeClient {
// 	
//     /**
//      * Default tag used for logging
//      */
// 	public static final String LOGGING_TAG  = "APIGEE_CLIENT";
// 	/**
//      * Most current version of the Apigee Android SDK
//      */
//     public static final String SDK_VERSION  = "2.0.14";
//     /**
//      * Platform type of this SDK
//      */
// 	public static final String SDK_TYPE     = "Android";
// 
// 	private ApigeeDataClient dataClient;
// 	private ApigeeMonitoringClient monitoringClient;
// 	private AppIdentification appIdentification;
// 
// 	
//     /**
//      * Instantiate client for a specific app.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, Context context) {
//     	this(organizationId,applicationId,null,null,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, and specify options for App Monitoring.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param monitoringOptions the options for application monitoring
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, MonitoringOptions monitoringOptions, Context context) {
//     	this(organizationId,applicationId,null,monitoringOptions,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, and specify an alternative baseURL for requests.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param baseURL the base URL to use for server communications
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, String baseURL, Context context) {
//     	this(organizationId,applicationId,baseURL,null,context);
//     }
// 
//     /**
//      * Instantiate client for a specific app, with an alternative baseURL for requests and options for
//      * App Monitoring.
//      * 
//      * @param organizationId the organization id or name
//      * @param applicationId  the application id or name
//      * @param baseURL the base URL to use for server communications
//      * @param monitoringOptions the options for application monitoring
//      * @param context the Android context
//      */
//     public ApigeeClient(String organizationId, String applicationId, String baseURL, MonitoringOptions monitoringOptions, Context context) {
//     	appIdentification = new AppIdentification(organizationId,applicationId);
//     	
//     	boolean urlSpecified = false;
//     	
//     	if ((baseURL != null) && (baseURL.length() > 0)) {
//     		urlSpecified = true;
//     		appIdentification.setBaseURL(baseURL);
//     	} else {
//     		appIdentification.setBaseURL(ApigeeDataClient.PUBLIC_API_URL);
//     	}
//     	
//         dataClient = new ApigeeDataClient(organizationId,applicationId,null,context);
//         Log.d(LOGGING_TAG,"dataClient created");
//         
//         if (urlSpecified) {
//         	dataClient.setApiUrl(baseURL);
//         }
// 
//         if ((monitoringOptions != null) && monitoringOptions.getMonitoringEnabled()) {
//         	monitoringClient = AppMon.initialize(appIdentification, dataClient, context, monitoringOptions);
//         	if( monitoringClient != null ) {
//         		Log.d(LOGGING_TAG,"monitoringClient created");
//         		ApigeeDataClient.setLogger(monitoringClient.getLogger());
//         	} else {
//         		Log.d(LOGGING_TAG,"unable to create monitoringClient");
//         		ApigeeDataClient.setLogger(new DefaultAndroidLog());
//         	}
//         } else {
//         	monitoringClient = AppMon.initialize(appIdentification, dataClient, context, monitoringOptions);
//         	if( monitoringClient != null ) {
//         		Log.d(LOGGING_TAG,"monitoringClient created");
//         		ApigeeDataClient.setLogger(monitoringClient.getLogger());
//         	} else {
//         		Log.d(LOGGING_TAG,"unable to create monitoringClient");
//         		ApigeeDataClient.setLogger(new DefaultAndroidLog());
//         	}
//         }
//     }
// 
//     /**
//      * Retrieve the instance of DataClient to use for data operations.
//      * 
//      * @return DataClient object
//      */
//     public ApigeeDataClient getDataClient() {
//     	return dataClient;
//     }
//     
//     /**
//      * Retrieve the instance of MonitoringClient to use for App Monitoring operations.
//      * 
//      * @return MonitoringClient object
//      */
//     public ApigeeMonitoringClient getMonitoringClient() {
//     	return monitoringClient;
//     }
//     
//     /**
//      * Retrieve the attributes that collectively identify the current application.
//      * 
//      * @return AppIdentification object
//      */
//     public AppIdentification getAppIdentification() {
//     	return appIdentification;
//     }
// }


// Path: new-project-template/src/com/apigee/appservices/android_template/MainActivity.java
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import com.apigee.fasterxml.jackson.databind.JsonNode;
import com.apigee.sdk.ApigeeClient;
import com.apigee.sdk.apm.android.Log;
import com.apigee.sdk.data.client.DataClient;
import com.apigee.sdk.data.client.callbacks.ApiResponseCallback;
import com.apigee.sdk.data.client.entities.Entity;
import com.apigee.sdk.data.client.response.ApiResponse;
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;

package com.apigee.appservices.android_template;



	
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final TextView text = (TextView) findViewById(R.id.mainActivityText);
        
    /* 
        1. Set your account details in the app

        - Enter your ORGNAME below� it's the username you picked when you signed up at apigee.com
        - Keep the APPNAME as 'sandbox': it's a context we automatically created for you.
          It's completely open by default, but don't worry, other apps you create are not!      */
        
        String ORGNAME = "YOUR-ORG"; // <-- Put your username here!!!
        String APPNAME = "sandbox";
        
        ApigeeClient apigeeClient = new ApigeeClient(ORGNAME,APPNAME,this.getBaseContext());