<commit_before>package com.apigee.sdkexplorer;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.Set;
import java.util.Date;

import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.apigee.sdkexplorer.R;
import com.apigee.sdk.ApigeeClient;
import com.apigee.sdk.apm.android.ApplicationConfigurationService;
import com.apigee.sdk.apm.android.ConfigurationReloadedListener;
import com.apigee.sdk.apm.android.MA;
import com.apigee.sdk.apm.android.MonitoringClient;
import com.apigee.sdk.apm.android.MonitoringOptions;
import com.apigee.sdk.apm.android.model.AppConfigCustomParameter;
import com.apigee.sdk.apm.android.model.ApplicationConfigurationModel;
import com.apigee.sdk.apm.android.UploadListener;


public class SDKExplorerActivity extends FragmentActivity implements ActionBar.TabListener, ConfigurationReloadedListener, UploadListener  {

	private static final int MENU_UPLOAD_METRICS = Menu.FIRST+2;
	private static final int MENU_REFRESH_CONFIG = Menu.FIRST+3;
	private static final int MENU_VIEW_LAST_METRICS_UPLOAD = Menu.FIRST+4;
	private static final int MENU_VIEW_LAST_CRASH_REPORT_UPLOAD = Menu.FIRST+5;

    private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";

    private static final String ORG_NAME = "dit1";
    private static final String APP_NAME = "sandbox";
    private static final String BASE_URL = "http://apigee-internal-prod.jupiter.apigee.net";

    private static boolean hadConnectivityOnStartup = false;
    public static int timeoutMillis = 5000;
    public static String networkHttpConnectionType = "HttpClient";
    
    private String lastMetricsUploadPayload = null;
    private Date lastMetricsUploadTime = null;
    private String lastCrashReportUploadPayload = null;
    private Date lastCrashReportUploadTime = null;
    private ApigeeClient apigeeClient = null;

    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        hadConnectivityOnStartup = haveConnectivityNow();
        
        MonitoringOptions monitoringOptions = new MonitoringOptions();
        monitoringOptions.setUploadListener(this);

        apigeeClient = new ApigeeClient(ORG_NAME,APP_NAME,BASE_URL,monitoringOptions,this);

        
        MonitoringClient monitoringClient = apigeeClient.getMonitoringClient();
        
        
        if ((null != monitoringClient) && monitoringClient.isInitialized()) {
    		
        	// hold onto the mobile analytics agent in our application object.
        	// we do this as a safeguard to prevent singletons from being
        	// garbage collected.
        	SDKExplorerApplication app = (SDKExplorerApplication) getApplication();
        	if( app.getMonitoringClient() == null ) {
        		app.setMonitoringClient(monitoringClient);
        	}
    		
        	ApplicationConfigurationService appConfigService = monitoringClient.getApplicationConfigurationService();
        	if (null != appConfigService) {
        		ApplicationConfigurationModel appConfigModel = appConfigService.getConfigurations();
        		if (null != appConfigModel) {
    				<commit_msg>Updated SDK Explorer to have placeholders for org/app name; removed base url value<commit_after>package com.apigee.sdkexplorer;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.Set;
import java.util.Date;

import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.apigee.sdkexplorer.R;
import com.apigee.sdk.ApigeeClient;
import com.apigee.sdk.apm.android.ApplicationConfigurationService;
import com.apigee.sdk.apm.android.ConfigurationReloadedListener;
import com.apigee.sdk.apm.android.MA;
import com.apigee.sdk.apm.android.MonitoringClient;
import com.apigee.sdk.apm.android.MonitoringOptions;
import com.apigee.sdk.apm.android.model.AppConfigCustomParameter;
import com.apigee.sdk.apm.android.model.ApplicationConfigurationModel;
import com.apigee.sdk.apm.android.UploadListener;


public class SDKExplorerActivity extends FragmentActivity implements ActionBar.TabListener, ConfigurationReloadedListener, UploadListener  {

	private static final int MENU_UPLOAD_METRICS = Menu.FIRST+2;
	private static final int MENU_REFRESH_CONFIG = Menu.FIRST+3;
	private static final int MENU_VIEW_LAST_METRICS_UPLOAD = Menu.FIRST+4;
	private static final int MENU_VIEW_LAST_CRASH_REPORT_UPLOAD = Menu.FIRST+5;

    private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";

    private static final String ORG_NAME = "<YOUR_ORG_NAME>";
    private static final String APP_NAME = "<YOUR_APP_NAME>";

    private static boolean hadConnectivityOnStartup = false;
    public static int timeoutMillis = 5000;
    public static String networkHttpConnectionType = "HttpClient";
    
    private String lastMetricsUploadPayload = null;
    private Date lastMetricsUploadTime = null;
    private String lastCrashReportUploadPayload = null;
    private Date lastCrashReportUploadTime = null;
    private ApigeeClient apigeeClient = null;

    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        hadConnectivityOnStartup = haveConnectivityNow();
        
        MonitoringOptions monitoringOptions = new MonitoringOptions();
        monitoringOptions.setUploadListener(this);

        apigeeClient = new ApigeeClient(ORG_NAME,APP_NAME,monitoringOptions,this);

        
        MonitoringClient monitoringClient = apigeeClient.getMonitoringClient();
        
        
        if ((null != monitoringClient) && monitoringClient.isInitialized()) {
    		
        	// hold onto the mobile analytics agent in our application object.
        	// we do this as a safeguard to prevent singletons from being
        	// garbage collected.
        	SDKExplorerApplication app = (SDKExplorerApplication) getApplication();
        	if( app.getMonitoringClient() == null ) {
        		app.setMonitoringClient(monitoringClient);
        	}
    		
        	ApplicationConfigurationService appConfigService = monitoringClient.getApplicationConfigurationService();
        	if (null != appConfigService) {
        		ApplicationConfigurationModel appConfigModel = appConfigService.getConfigurations();
        		if (null != appConfigModel) {
    				
{'fraction_non_alphanumeric': 0.07597623089983022, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 4.244065281899109, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2655205', 'n_tokens_mistral': 2038, 'n_tokens_neox': 1977, 'n_words': 434}