code: public static Analytics with(Context context) {
      if (singleton == null) {
        if (context == null) {
          throw new IllegalArgumentException("Context must not be null.");
        }
        synchronized (Analytics.class) {
          if (singleton == null) {
            String writeKey = getResourceString(context, WRITE_KEY_RESOURCE_IDENTIFIER);
            Builder builder = new Builder(context, writeKey);
  
            try {
              String packageName = context.getPackageName();
              int flags = context.getPackageManager().getApplicationInfo(packageName, 0).flags;
              boolean debugging = (flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
              if (debugging) {
                builder.logLevel(LogLevel.INFO);
              }
            } catch (PackageManager.NameNotFoundException ignored) {
            }
  
            singleton = builder.build();
          }
        }
      }
      return singleton;
    }
docs: Return a reference to the global default {@link Analytics} instance.
  
  <p>This instance is automatically initialized with defaults that are suitable to most
  implementations.
  
  <p>If these settings do not meet the requirements of your application, you can override
  defaults in {@code analytics.xml}, or you can construct your own instance with full control
  over the configuration by using {@link Builder}.
  
  <p>By default, events are uploaded every 30 seconds, or every 20 events (whichever occurs
  first), and debugging is disabled.